diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md index b505d3ccbe645..f49c5fb947b2c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0-beta.1 (2022-11-16) + +- 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-2022-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + ## 1.0.0-beta.3 (2022-11-09) - 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). diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md index 7b1f7b11e3d2c..eae39eb6c11e1 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-2022-12. 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 diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md index d88eed2705ac3..2dcd17e8a4107 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md @@ -58,6 +58,8 @@ - [Start](#compute_start) - [Stop](#compute_stop) - [Update](#compute_update) +- [UpdateCustomServices](#compute_updatecustomservices) +- [UpdateIdleShutdownSetting](#compute_updateidleshutdownsetting) ## DataContainers @@ -103,6 +105,16 @@ - [Get](#jobs_get) - [List](#jobs_list) +## LabelingJobs + +- [CreateOrUpdate](#labelingjobs_createorupdate) +- [Delete](#labelingjobs_delete) +- [ExportLabels](#labelingjobs_exportlabels) +- [Get](#labelingjobs_get) +- [List](#labelingjobs_list) +- [Pause](#labelingjobs_pause) +- [Resume](#labelingjobs_resume) + ## ModelContainers - [CreateOrUpdate](#modelcontainers_createorupdate) @@ -158,6 +170,71 @@ - [List](#quotas_list) - [Update](#quotas_update) +## Registries + +- [CreateOrUpdate](#registries_createorupdate) +- [Delete](#registries_delete) +- [GetByResourceGroup](#registries_getbyresourcegroup) +- [List](#registries_list) +- [ListByResourceGroup](#registries_listbyresourcegroup) +- [Update](#registries_update) + +## RegistryCodeContainers + +- [CreateOrUpdate](#registrycodecontainers_createorupdate) +- [Delete](#registrycodecontainers_delete) +- [Get](#registrycodecontainers_get) +- [List](#registrycodecontainers_list) + +## RegistryCodeVersions + +- [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) + +## 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 + +- [CreateOrUpdate](#registrymodelversions_createorupdate) +- [Delete](#registrymodelversions_delete) +- [Get](#registrymodelversions_get) +- [List](#registrymodelversions_list) + ## Schedules - [CreateOrUpdate](#schedules_createorupdate) @@ -225,14 +302,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/2022-12-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() @@ -306,14 +383,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", Context.NONE); @@ -329,14 +407,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", Context.NONE); @@ -352,14 +431,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, Context.NONE); @@ -379,14 +459,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/2022-12-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() @@ -429,14 +510,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/2022-12-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() @@ -486,14 +567,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -507,14 +589,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -528,14 +611,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); } } @@ -549,14 +633,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -578,15 +663,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/2022-12-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() @@ -623,6 +708,8 @@ public final class BatchEndpointsUpdateSamples { ### CodeContainers_CreateOrUpdate ```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; import java.util.HashMap; import java.util.Map; @@ -630,24 +717,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/2022-12-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"))), + Context.NONE); } @SuppressWarnings("unchecked") @@ -671,14 +761,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -692,14 +783,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -713,14 +805,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); } } @@ -729,6 +822,8 @@ public final class CodeContainersListSamples { ### CodeVersions_CreateOrUpdate ```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; import java.util.HashMap; import java.util.Map; @@ -736,27 +831,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/2022-12-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")), + Context.NONE); } @SuppressWarnings("unchecked") @@ -780,14 +879,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -801,14 +901,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -822,14 +923,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); } } @@ -838,6 +940,8 @@ public final class CodeVersionsListSamples { ### ComponentContainers_CreateOrUpdate ```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -845,25 +949,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/2022-12-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"))), + Context.NONE); } @SuppressWarnings("unchecked") @@ -887,14 +994,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().deleteWithResponse("test-rg", "my-aml-workspace", "string", Context.NONE); } @@ -909,14 +1016,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -930,14 +1038,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); } @@ -948,7 +1056,9 @@ public final class ComponentContainersListSamples { ```java import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; 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; @@ -957,33 +1067,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/2022-12-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))), + Context.NONE); } @SuppressWarnings("unchecked") @@ -1007,14 +1121,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", Context.NONE); } @@ -1029,14 +1143,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -1050,14 +1165,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); @@ -1076,29 +1192,42 @@ 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.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.SshPublicAccess; 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/2022-12-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. @@ -1116,7 +1245,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/2022-12-01-preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. @@ -1139,7 +1268,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/2022-12-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. @@ -1176,7 +1305,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. @@ -1209,7 +1338,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * 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/2022-12-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. @@ -1245,7 +1374,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. @@ -1266,8 +1395,46 @@ 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) .withPersonalComputeInstanceSettings( new PersonalComputeInstanceSettings() @@ -1279,7 +1446,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. @@ -1299,7 +1466,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/2022-12-01-preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. @@ -1326,7 +1493,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/2022-12-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json */ /** * Sample code: Create a DataFactory Compute. @@ -1366,7 +1533,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/2022-12-01-preview/examples/Compute/delete.json */ /** * Sample code: Delete Compute. @@ -1389,7 +1556,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/get/AKSCompute.json */ /** * Sample code: Get a AKS Compute. @@ -1401,7 +1568,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/2022-12-01-preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. @@ -1413,7 +1580,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/2022-12-01-preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. @@ -1425,7 +1592,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/2022-12-01-preview/examples/Compute/get/AmlCompute.json */ /** * Sample code: Get a AML Compute. @@ -1446,7 +1613,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/list.json */ /** * Sample code: Get Computes. @@ -1467,7 +1634,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/listKeys.json */ /** * Sample code: List AKS Compute Keys. @@ -1488,7 +1655,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/listNodes.json */ /** * Sample code: Get compute nodes information for a compute. @@ -1510,7 +1677,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/restart.json */ /** * Sample code: Restart ComputeInstance Compute. @@ -1532,7 +1699,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/start.json */ /** * Sample code: Start ComputeInstance Compute. @@ -1554,7 +1721,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Compute/stop.json */ /** * Sample code: Stop ComputeInstance Compute. @@ -1580,7 +1747,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/2022-12-01-preview/examples/Compute/patch.json */ /** * Sample code: Update a AmlCompute Compute. @@ -1605,6 +1772,121 @@ public final class ComputeUpdateSamples { } ``` +### Compute_UpdateCustomServices + +```java +import com.azure.core.util.Context; +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/2022-12-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())), + 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; + } +} +``` + +### Compute_UpdateIdleShutdownSetting + +```java +import com.azure.core.util.Context; +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/2022-12-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"), + Context.NONE); + } +} +``` + ### DataContainers_CreateOrUpdate ```java @@ -1616,14 +1898,14 @@ 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/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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() @@ -1659,14 +1941,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -1680,14 +1963,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -1701,14 +1985,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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, Context.NONE); } } @@ -1724,14 +2009,14 @@ 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/2022-12-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() @@ -1768,14 +2053,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -1789,14 +2075,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -1810,14 +2097,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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("test-rg", "my-aml-workspace", "string", "string", 1, null, "string", null, Context.NONE); @@ -1843,7 +2131,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/2022-12-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen1 w/ ServicePrincipal). @@ -1874,7 +2162,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/2022-12-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen2 w/ Service Principal). @@ -1908,7 +2196,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/2022-12-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (AzureBlob w/ AccountKey). @@ -1937,7 +2225,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/2022-12-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure File store w/ AccountKey). @@ -1986,7 +2274,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Datastore/delete.json */ /** * Sample code: Delete datastore. @@ -2007,7 +2295,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Datastore/get.json */ /** * Sample code: Get datastore. @@ -2029,7 +2317,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/2022-12-01-preview/examples/Datastore/list.json */ /** * Sample code: List datastores. @@ -2062,7 +2350,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Datastore/listSecrets.json */ /** * Sample code: Get datastore secrets. @@ -2078,6 +2366,8 @@ public final class DatastoresListSecretsSamples { ### EnvironmentContainers_CreateOrUpdate ```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -2085,27 +2375,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/2022-12-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"))), + Context.NONE); } @SuppressWarnings("unchecked") @@ -2129,14 +2434,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().deleteWithResponse("testrg123", "testworkspace", "testContainer", Context.NONE); } @@ -2151,14 +2456,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().getWithResponse("testrg123", "testworkspace", "testEnvironment", Context.NONE); } @@ -2173,14 +2478,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().list("testrg123", "testworkspace", null, null, Context.NONE); } @@ -2190,6 +2495,8 @@ public final class EnvironmentContainersListSamples { ### EnvironmentVersions_CreateOrUpdate ```java +import com.azure.core.util.Context; +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; @@ -2200,38 +2507,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/2022-12-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)))), + Context.NONE); } @SuppressWarnings("unchecked") @@ -2255,14 +2566,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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 +2590,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -2300,14 +2612,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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() @@ -2324,7 +2636,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Job/cancel.json */ /** * Sample code: Cancel Job. @@ -2344,6 +2656,7 @@ 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.AutologgerSettings; import com.azure.resourcemanager.machinelearning.models.CommandJob; import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; import com.azure.resourcemanager.machinelearning.models.Goal; @@ -2355,6 +2668,7 @@ import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassi 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.MLFlowAutologgerState; import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; import com.azure.resourcemanager.machinelearning.models.Mpi; @@ -2375,7 +2689,7 @@ import java.util.Map; /** 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/2022-12-01-preview/examples/Job/AutoMLJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate AutoML Job. @@ -2443,7 +2757,7 @@ public final class JobsCreateOrUpdateSamples { } /* - * 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/2022-12-01-preview/examples/Job/SweepJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Sweep Job. @@ -2508,7 +2822,7 @@ public final class JobsCreateOrUpdateSamples { } /* - * 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/2022-12-01-preview/examples/Job/PipelineJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Pipeline Job. @@ -2553,7 +2867,7 @@ public final class JobsCreateOrUpdateSamples { } /* - * 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/2022-12-01-preview/examples/Job/CommandJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Command Job. @@ -2583,6 +2897,8 @@ public final class JobsCreateOrUpdateSamples { .withJobServiceType("string") .withPort(1) .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.ENABLED)) .withCodeId("fakeTokenPlaceholder") .withCommand("string") .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) @@ -2634,7 +2950,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Job/delete.json */ /** * Sample code: Delete Job. @@ -2655,7 +2971,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Job/CommandJob/get.json */ /** * Sample code: Get Command Job. @@ -2667,7 +2983,7 @@ public final class JobsGetSamples { } /* - * 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/2022-12-01-preview/examples/Job/AutoMLJob/get.json */ /** * Sample code: Get AutoML Job. @@ -2679,7 +2995,7 @@ public final class JobsGetSamples { } /* - * 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/2022-12-01-preview/examples/Job/SweepJob/get.json */ /** * Sample code: Get Sweep Job. @@ -2691,7 +3007,7 @@ public final class JobsGetSamples { } /* - * 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/2022-12-01-preview/examples/Job/PipelineJob/get.json */ /** * Sample code: Get Pipeline Job. @@ -2712,7 +3028,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Job/CommandJob/list.json */ /** * Sample code: List Command Job. @@ -2720,11 +3036,11 @@ public final class JobsListSamples { * @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", null, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/PipelineJob/list.json */ /** * Sample code: List Pipeline Job. @@ -2732,11 +3048,11 @@ public final class JobsListSamples { * @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, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/SweepJob/list.json */ /** * Sample code: List Sweep Job. @@ -2744,11 +3060,11 @@ public final class JobsListSamples { * @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", null, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/AutoMLJob/list.json */ /** * Sample code: List AutoML Job. @@ -2756,38 +3072,77 @@ public final class JobsListSamples { * @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, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, null, null, Context.NONE); } } ``` -### ModelContainers_CreateOrUpdate +### LabelingJobs_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +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 ModelContainers CreateOrUpdate. */ -public final class ModelContainersCreateOrUpdateSamples { +/** Samples for LabelingJobs CreateOrUpdate. */ +public final class LabelingJobsCreateOrUpdateSamples { /* - * 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/2022-12-01-preview/examples/LabelingJob/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Container. + * Sample code: CreateOrUpdate Labeling Job. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelContainer( + public static void createOrUpdateLabelingJob( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "workspace123") + .labelingJobs() + .define("testLabelingJob") + .withExistingWorkspace("workspace-1234", "testworkspace") .withProperties( - new ModelContainerProperties() - .withDescription("Model container description") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + 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(); } @@ -2804,103 +3159,293 @@ public final class ModelContainersCreateOrUpdateSamples { } ``` -### ModelContainers_Delete +### LabelingJobs_Delete ```java import com.azure.core.util.Context; -/** Samples for ModelContainers Delete. */ -public final class ModelContainersDeleteSamples { +/** Samples for LabelingJobs Delete. */ +public final class LabelingJobsDeleteSamples { /* - * 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/2022-12-01-preview/examples/LabelingJob/delete.json */ /** - * Sample code: Delete Model Container. + * Sample code: Delete Labeling Job. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.modelContainers().deleteWithResponse("testrg123", "workspace123", "testContainer", Context.NONE); + public static void deleteLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.labelingJobs().deleteWithResponse("workspace-1234", "testworkspace", "testLabelingJob", Context.NONE); } } ``` -### ModelContainers_Get +### LabelingJobs_ExportLabels ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.models.DatasetExportSummary; -/** Samples for ModelContainers Get. */ -public final class ModelContainersGetSamples { +/** Samples for LabelingJobs ExportLabels. */ +public final class LabelingJobsExportLabelsSamples { /* - * 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/2022-12-01-preview/examples/LabelingJob/exportLabels.json */ /** - * Sample code: Get Model Container. + * Sample code: ExportLabels Labeling Job. * * @param manager Entry point to MachineLearningManager. */ - public static void getModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.modelContainers().getWithResponse("testrg123", "workspace123", "testContainer", Context.NONE); + public static void exportLabelsLabelingJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .exportLabels( + "workspace-1234", "testworkspace", "testLabelingJob", new DatasetExportSummary(), Context.NONE); } } ``` -### ModelContainers_List +### LabelingJobs_Get ```java import com.azure.core.util.Context; -/** Samples for ModelContainers List. */ -public final class ModelContainersListSamples { +/** Samples for LabelingJobs Get. */ +public final class LabelingJobsGetSamples { /* - * 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/2022-12-01-preview/examples/LabelingJob/get.json */ /** - * Sample code: List Model Container. + * Sample code: Get Labeling Job. * * @param manager Entry point to MachineLearningManager. */ - public static void listModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.modelContainers().list("testrg123", "workspace123", null, null, null, Context.NONE); + public static void getLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .getWithResponse("workspace-1234", "testworkspace", "testLabelingJob", true, true, Context.NONE); } } ``` -### ModelVersions_CreateOrUpdate +### LabelingJobs_List ```java -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; +import com.azure.core.util.Context; + +/** Samples for LabelingJobs List. */ +public final class LabelingJobsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### LabelingJobs_Pause + +```java +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Pause. */ +public final class LabelingJobsPauseSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### LabelingJobs_Resume + +```java +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Resume. */ +public final class LabelingJobsResumeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### ModelContainers_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/2022-12-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"))), + 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 +import com.azure.core.util.Context; + +/** Samples for ModelContainers Delete. */ +public final class ModelContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### ModelContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ModelContainers Get. */ +public final class ModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### ModelContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for ModelContainers List. */ +public final class ModelContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### ModelVersions_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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")), + Context.NONE); } @SuppressWarnings("unchecked") @@ -2924,14 +3469,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -2945,14 +3491,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -2966,14 +3513,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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( @@ -3018,7 +3566,7 @@ import java.util.Map; /** 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/2022-12-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Kubernetes Online Deployment. @@ -3083,7 +3631,7 @@ public final class OnlineDeploymentsCreateOrUpdateSamples { } /* - * 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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Managed Online Deployment. @@ -3166,14 +3714,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().delete("testrg123", "workspace123", "testEndpoint", "testDeployment", Context.NONE); } @@ -3188,7 +3736,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json */ /** * Sample code: Get Kubernetes Online Deployment. @@ -3203,7 +3751,7 @@ public final class OnlineDeploymentsGetSamples { } /* - * 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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json */ /** * Sample code: Get Managed Online Deployment. @@ -3229,7 +3777,7 @@ 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/stable/2022-10-01/examples/OnlineDeployment/getLogs.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/examples/OnlineDeployment/getLogs.json */ /** * Sample code: Get Online Deployment Logs. @@ -3259,7 +3807,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/OnlineDeployment/list.json */ /** * Sample code: List Online Deployments. @@ -3282,7 +3830,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json */ /** * Sample code: List Managed Online Deployment Skus. @@ -3297,7 +3845,7 @@ public final class OnlineDeploymentsListSkusSamples { } /* - * 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/2022-12-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json */ /** * Sample code: List Kubernetes Online Deployment Skus. @@ -3326,7 +3874,7 @@ import java.util.Map; /** 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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json */ /** * Sample code: Update Managed Online Deployment. @@ -3354,7 +3902,7 @@ public final class OnlineDeploymentsUpdateSamples { } /* - * 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/2022-12-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json */ /** * Sample code: Update Kubernetes Online Deployment. @@ -3410,14 +3958,14 @@ import java.util.Map; /** 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/2022-12-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() @@ -3468,14 +4016,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -3489,14 +4038,15 @@ import com.azure.core.util.Context; /** 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/2022-12-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", Context.NONE); } } @@ -3510,14 +4060,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", Context.NONE); } @@ -3534,14 +4084,15 @@ 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/stable/2022-10-01/examples/OnlineEndpoint/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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( @@ -3567,14 +4118,14 @@ import com.azure.core.util.Context; /** 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/2022-12-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().listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", Context.NONE); } @@ -3591,14 +4142,14 @@ import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRe /** 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/2022-12-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() @@ -3628,15 +4179,15 @@ import java.util.Map; /** 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/2022-12-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() @@ -3678,7 +4229,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/operationsList.json */ /** * Sample code: OperationsList. @@ -3700,7 +4251,7 @@ import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnec /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json */ /** * Sample code: WorkspacePutPrivateEndpointConnection. @@ -3730,7 +4281,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/delete.json */ /** * Sample code: WorkspaceDeletePrivateEndpointConnection. @@ -3754,7 +4305,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/get.json */ /** * Sample code: WorkspaceGetPrivateEndpointConnection. @@ -3778,7 +4329,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/list.json */ /** * Sample code: StorageAccountListPrivateEndpointConnections. @@ -3800,7 +4351,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/PrivateLinkResource/list.json */ /** * Sample code: WorkspaceListPrivateLinkResources. @@ -3822,7 +4373,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Quota/list.json */ /** * Sample code: List workspace quotas by VMFamily. @@ -3848,7 +4399,7 @@ import java.util.Arrays; /** 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/2022-12-01-preview/examples/Quota/update.json */ /** * Sample code: update quotas. @@ -3881,6 +4432,1318 @@ public final class QuotasUpdateSamples { } ``` +### Registries_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.RegistryProperties; +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/2022-12-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") + .withProperties( + new RegistryProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountSku("string") + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountType("string") + .withAllowBlobPublicAccess(false))))))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.BASIC) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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") + .withProperties( + new RegistryProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "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")))))))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.BASIC) + .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; + } +} +``` + +### Registries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### Registries_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### Registries_List + +```java +import com.azure.core.util.Context; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistries(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(null, Context.NONE); + } +} +``` + +### Registries_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", null, Context.NONE); + } +} +``` + +### Registries_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.io.IOException; +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/2022-12-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) throws IOException { + Registry resource = + manager.registries().getByResourceGroupWithResponse("test-rg", "string", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new PartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withKind("string") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .apply(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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) throws IOException { + Registry resource = + manager.registries().getByResourceGroupWithResponse("test-rg", "string", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new PartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withKind("string") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .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/preview/2022-12-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; + } +} +``` + +### RegistryCodeContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers Delete. */ +public final class RegistryCodeContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryCodeContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers Get. */ +public final class RegistryCodeContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryCodeContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers List. */ +public final class RegistryCodeContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryCodeVersions_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryCodeVersions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions Delete. */ +public final class RegistryCodeVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryCodeVersions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions Get. */ +public final class RegistryCodeVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryCodeVersions_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions List. */ +public final class RegistryCodeVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryComponentContainers_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryComponentContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers Delete. */ +public final class RegistryComponentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryComponentContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers Get. */ +public final class RegistryComponentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryComponentContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers List. */ +public final class RegistryComponentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryComponentVersions_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryComponentVersions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentVersions Delete. */ +public final class RegistryComponentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryComponentVersions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentVersions Get. */ +public final class RegistryComponentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryComponentVersions_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryComponentVersions List. */ +public final class RegistryComponentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryEnvironmentContainers_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryEnvironmentContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentContainers Delete. */ +public final class RegistryEnvironmentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryEnvironmentContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentContainers Get. */ +public final class RegistryEnvironmentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryEnvironmentContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentContainers List. */ +public final class RegistryEnvironmentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryEnvironmentVersions_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryEnvironmentVersions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentVersions Delete. */ +public final class RegistryEnvironmentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryEnvironmentVersions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentVersions Get. */ +public final class RegistryEnvironmentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryEnvironmentVersions_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentVersions List. */ +public final class RegistryEnvironmentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryModelContainers_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryModelContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers Delete. */ +public final class RegistryModelContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryModelContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers Get. */ +public final class RegistryModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryModelContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers List. */ +public final class RegistryModelContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, Context.NONE); + } +} +``` + +### RegistryModelVersions_CreateOrUpdate + +```java +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/2022-12-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; + } +} +``` + +### RegistryModelVersions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions Delete. */ +public final class RegistryModelVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryModelVersions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions Get. */ +public final class RegistryModelVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } +} +``` + +### RegistryModelVersions_List + +```java +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions List. */ +public final class RegistryModelVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, + Context.NONE); + } +} +``` + ### Schedules_CreateOrUpdate ```java @@ -3896,7 +5759,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/2022-12-01-preview/examples/Schedule/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Schedule. @@ -3955,7 +5818,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Schedule/delete.json */ /** * Sample code: Delete Schedule. @@ -3976,7 +5839,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Schedule/get.json */ /** * Sample code: Get Schedule. @@ -3997,7 +5860,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Schedule/list.json */ /** * Sample code: List Schedules. @@ -4018,7 +5881,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Usage/list.json */ /** * Sample code: List Usages. @@ -4039,7 +5902,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/VirtualMachineSize/list.json */ /** * Sample code: List VM Sizes. @@ -4055,13 +5918,12 @@ public final class VirtualMachineSizesListSamples { ### WorkspaceConnections_Create ```java -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; /** 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/2022-12-01-preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. @@ -4076,7 +5938,7 @@ public final class WorkspaceConnectionsCreateSamples { .withExistingWorkspace("resourceGroup-1", "workspace-1") .withProperties( new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withCategory("ContainerRegistry") .withTarget("www.facebook.com")) .create(); } @@ -4091,7 +5953,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/WorkspaceConnection/delete.json */ /** * Sample code: DeleteWorkspaceConnection. @@ -4115,7 +5977,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/WorkspaceConnection/get.json */ /** * Sample code: GetWorkspaceConnection. @@ -4137,7 +5999,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/WorkspaceConnection/list.json */ /** * Sample code: ListWorkspaceConnections. @@ -4161,7 +6023,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/WorkspaceFeature/list.json */ /** * Sample code: List Workspace features. @@ -4193,7 +6055,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/2022-12-01-preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. @@ -4270,7 +6132,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. @@ -4295,7 +6157,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/2022-12-01-preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. @@ -4344,7 +6206,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/get.json */ /** * Sample code: Get Workspace. @@ -4365,7 +6227,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. @@ -4387,7 +6249,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. @@ -4409,7 +6271,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/listKeys.json */ /** * Sample code: List Workspace Keys. @@ -4430,7 +6292,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/listNotebookAccessToken.json */ /** * Sample code: List Workspace Keys. @@ -4451,7 +6313,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Notebook/listKeys.json */ /** * Sample code: List Workspace Keys. @@ -4472,7 +6334,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/ExternalFQDN/get.json */ /** * Sample code: ListOutboundNetworkDependenciesEndpoints. @@ -4496,7 +6358,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/listStorageAccountKeys.json */ /** * Sample code: List Workspace Keys. @@ -4517,7 +6379,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Notebook/prepare.json */ /** * Sample code: Prepare Notebook. @@ -4538,7 +6400,7 @@ import com.azure.core.util.Context; /** 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/2022-12-01-preview/examples/Workspace/resyncKeys.json */ /** * Sample code: Resync Workspace Keys. @@ -4561,7 +6423,7 @@ 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/2022-12-01-preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml index 2dc655dc70051..4a474e6a00e03 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml @@ -13,7 +13,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-2022-12. https://github.com/Azure/azure-sdk-for-java 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 7aa5866e403f0..7499ab164c2bd 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; @@ -38,6 +38,7 @@ import com.azure.resourcemanager.machinelearning.implementation.EnvironmentContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.EnvironmentVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.JobsImpl; +import com.azure.resourcemanager.machinelearning.implementation.LabelingJobsImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.OnlineDeploymentsImpl; @@ -46,6 +47,15 @@ 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.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; @@ -65,6 +75,7 @@ import com.azure.resourcemanager.machinelearning.models.EnvironmentContainers; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersions; import com.azure.resourcemanager.machinelearning.models.Jobs; +import com.azure.resourcemanager.machinelearning.models.LabelingJobs; import com.azure.resourcemanager.machinelearning.models.ModelContainers; import com.azure.resourcemanager.machinelearning.models.ModelVersions; import com.azure.resourcemanager.machinelearning.models.OnlineDeployments; @@ -73,6 +84,15 @@ 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.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; @@ -109,6 +129,22 @@ public final class MachineLearningManager { private WorkspaceConnections workspaceConnections; + private RegistryCodeContainers registryCodeContainers; + + private RegistryCodeVersions registryCodeVersions; + + private RegistryComponentContainers registryComponentContainers; + + private RegistryComponentVersions registryComponentVersions; + + private RegistryEnvironmentContainers registryEnvironmentContainers; + + private RegistryEnvironmentVersions registryEnvironmentVersions; + + private RegistryModelContainers registryModelContainers; + + private RegistryModelVersions registryModelVersions; + private BatchEndpoints batchEndpoints; private BatchDeployments batchDeployments; @@ -133,6 +169,8 @@ public final class MachineLearningManager { private Jobs jobs; + private LabelingJobs labelingJobs; + private ModelContainers modelContainers; private ModelVersions modelVersions; @@ -143,15 +181,17 @@ public final class MachineLearningManager { private Schedules schedules; + private Registries registries; + private WorkspaceFeatures workspaceFeatures; - private final AzureMachineLearningWorkspaces clientObject; + 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 +350,7 @@ public MachineLearningManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.machinelearning") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -477,6 +517,108 @@ public WorkspaceConnections workspaceConnections() { return workspaceConnections; } + /** + * Gets the resource collection API of RegistryCodeContainers. It manages CodeContainer. + * + * @return Resource collection API of RegistryCodeContainers. + */ + public RegistryCodeContainers registryCodeContainers() { + if (this.registryCodeContainers == null) { + this.registryCodeContainers = + new RegistryCodeContainersImpl(clientObject.getRegistryCodeContainers(), this); + } + return registryCodeContainers; + } + + /** + * Gets the resource collection API of RegistryCodeVersions. It manages CodeVersion. + * + * @return Resource collection API of RegistryCodeVersions. + */ + public RegistryCodeVersions registryCodeVersions() { + if (this.registryCodeVersions == null) { + this.registryCodeVersions = new RegistryCodeVersionsImpl(clientObject.getRegistryCodeVersions(), this); + } + return registryCodeVersions; + } + + /** + * Gets the resource collection API of RegistryComponentContainers. It manages ComponentContainer. + * + * @return Resource collection API of RegistryComponentContainers. + */ + public RegistryComponentContainers registryComponentContainers() { + if (this.registryComponentContainers == null) { + this.registryComponentContainers = + new RegistryComponentContainersImpl(clientObject.getRegistryComponentContainers(), this); + } + 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 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; + } + /** * Gets the resource collection API of BatchEndpoints. It manages BatchEndpoint. * @@ -502,7 +644,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 +656,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 +668,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 +680,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. */ @@ -586,7 +728,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 +740,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. */ @@ -622,7 +764,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 +788,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 +835,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 +860,10 @@ public WorkspaceFeatures workspaceFeatures() { } /** - * @return Wrapped service client AzureMachineLearningWorkspaces providing direct access to the underlying + * @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/AzureMachineLearningWorkspaces.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java similarity index 72% rename from sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java rename to sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java index e8a40ef9b43c9..ea449242fe3bf 100644 --- 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/AzureMachineLearningServices.java @@ -7,8 +7,8 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AzureMachineLearningWorkspaces class. */ -public interface AzureMachineLearningWorkspaces { +/** The interface for AzureMachineLearningServices class. */ +public interface AzureMachineLearningServices { /** * Gets The ID of the target subscription. * @@ -107,6 +107,62 @@ public interface AzureMachineLearningWorkspaces { */ WorkspaceConnectionsClient getWorkspaceConnections(); + /** + * 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 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. * @@ -191,6 +247,13 @@ public interface AzureMachineLearningWorkspaces { */ JobsClient getJobs(); + /** + * Gets the LabelingJobsClient object to access its operations. + * + * @return the LabelingJobsClient object. + */ + LabelingJobsClient getLabelingJobs(); + /** * Gets the ModelContainersClient object to access its operations. * @@ -226,6 +289,13 @@ public interface AzureMachineLearningWorkspaces { */ SchedulesClient getSchedules(); + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + RegistriesClient getRegistries(); + /** * Gets the WorkspaceFeaturesClient object to access its operations. * 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..c231832b90dd4 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 @@ -15,7 +15,10 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; 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.UnderlyingResourceAction; +import java.util.List; /** An instance of this class provides access to all the operations defined in ComputesClient. */ public interface ComputesClient { @@ -318,6 +321,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 +591,40 @@ 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); } 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..28d4af1f131d0 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 @@ -38,6 +38,8 @@ 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 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 +54,8 @@ PagedIterable list( String jobType, String tag, ListViewType listViewType, + Boolean scheduled, + String scheduleId, Context context); /** 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/OperationsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java index cf8b8217b3035..c216f9607b5f1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java @@ -13,7 +13,7 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -24,7 +24,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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..38a5f4ee136fd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.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.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; +import com.azure.resourcemanager.machinelearning.models.RegistriesUpdateResponse; + +/** 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 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 Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skip, 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 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 Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of 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 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 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 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 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 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 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) + RegistriesUpdateResponse 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 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 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 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 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 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); +} 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..42c8a28385e4a --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, 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. + * @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 container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner get(String resourceGroupName, String registryName, String codeName); + + /** + * 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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..89574be7fc483 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java @@ -0,0 +1,230 @@ +// Copyright (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; + +/** 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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); +} 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..3197fdd9b318a --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..321e73f57f656 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.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.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. + * @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. + * @param componentName 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 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, + 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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/RegistryEnvironmentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java new file mode 100644 index 0000000000000..2c958ed581ed3 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..319296cafbe36 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java @@ -0,0 +1,241 @@ +// Copyright (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. + * @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. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, + 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..0432dfff608cd --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..cd674f8a6e94b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java @@ -0,0 +1,241 @@ +// Copyright (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.models.ListViewType; + +/** 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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); +} 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..351abd4f5d199 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 @@ -8,7 +8,7 @@ import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** Azure Machine Learning workspace REST API operation. */ +/** Azure Machine Learning REST API operation. */ @Fluent public final class AmlOperationInner { /* 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/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/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..39ab272f69382 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java @@ -0,0 +1,181 @@ +// Copyright (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.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.RegistryProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +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 properties; + + /* + * 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 properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public RegistryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withProperties(RegistryProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model RegistryInner")); + } else { + properties().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/WorkspaceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java index 0574f791c1fea..e0b63a99aa7af 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 @@ -9,11 +9,11 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; 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.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspaceProvisioningState; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -343,7 +343,7 @@ public WorkspaceInner withDiscoveryUrl(String discoveryUrl) { * * @return the provisioningState value. */ - public ProvisioningState provisioningState() { + public WorkspaceProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } @@ -629,6 +629,24 @@ public WorkspaceInner withV1LegacyMode(Boolean v1LegacyMode) { return this; } + /** + * Get the softDeletedAt property: The timestamp when the workspace was soft deleted. + * + * @return the softDeletedAt value. + */ + public String softDeletedAt() { + return this.innerProperties() == null ? null : this.innerProperties().softDeletedAt(); + } + + /** + * Get the scheduledPurgeDate property: The timestamp when the soft deleted workspace is going to be purged. + * + * @return the scheduledPurgeDate value. + */ + public String scheduledPurgeDate() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledPurgeDate(); + } + /** * Validates the instance. * 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..cc50db7ec1b69 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,10 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; -import com.azure.resourcemanager.machinelearning.models.ProvisioningState; import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; +import com.azure.resourcemanager.machinelearning.models.WorkspaceProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -71,7 +71,7 @@ public final class WorkspacePropertiesInner { * provisioning. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private WorkspaceProvisioningState provisioningState; /* * The encryption settings of Azure ML workspace. @@ -170,6 +170,18 @@ public final class WorkspacePropertiesInner { @JsonProperty(value = "v1LegacyMode") private Boolean v1LegacyMode; + /* + * The timestamp when the workspace was soft deleted + */ + @JsonProperty(value = "softDeletedAt", access = JsonProperty.Access.WRITE_ONLY) + private String softDeletedAt; + + /* + * The timestamp when the soft deleted workspace is going to be purged + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private String scheduledPurgeDate; + /** Creates an instance of WorkspacePropertiesInner class. */ public WorkspacePropertiesInner() { } @@ -335,7 +347,7 @@ public WorkspacePropertiesInner withDiscoveryUrl(String discoveryUrl) { * * @return the provisioningState value. */ - public ProvisioningState provisioningState() { + public WorkspaceProvisioningState provisioningState() { return this.provisioningState; } @@ -595,6 +607,24 @@ public WorkspacePropertiesInner withV1LegacyMode(Boolean v1LegacyMode) { return this; } + /** + * Get the softDeletedAt property: The timestamp when the workspace was soft deleted. + * + * @return the softDeletedAt value. + */ + public String softDeletedAt() { + return this.softDeletedAt; + } + + /** + * Get the scheduledPurgeDate property: The timestamp when the soft deleted workspace is going to be purged. + * + * @return the scheduledPurgeDate value. + */ + public String scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + /** * Validates the instance. * 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 index ecf35a74ba330..058fc99d5d8ba 100644 --- 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 @@ -5,6 +5,7 @@ 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.PublicNetworkAccess; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.fasterxml.jackson.annotation.JsonProperty; @@ -60,6 +61,12 @@ public final class WorkspacePropertiesUpdateParameters { @JsonProperty(value = "containerRegistry") private String containerRegistry; + /* + * The encryption settings of the workspace. + */ + @JsonProperty(value = "encryption") + private EncryptionUpdateProperties encryption; + /** Creates an instance of WorkspacePropertiesUpdateParameters class. */ public WorkspacePropertiesUpdateParameters() { } @@ -227,6 +234,26 @@ public WorkspacePropertiesUpdateParameters withContainerRegistry(String containe return this; } + /** + * Get the encryption property: The encryption settings of the workspace. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings of the workspace. + * + * @param encryption the encryption value to set. + * @return the WorkspacePropertiesUpdateParameters object itself. + */ + public WorkspacePropertiesUpdateParameters withEncryption(EncryptionUpdateProperties encryption) { + this.encryption = encryption; + return this; + } + /** * Validates the instance. * @@ -236,5 +263,8 @@ public void validate() { if (serviceManagedResourcesSettings() != null) { serviceManagedResourcesSettings().validate(); } + if (encryption() != null) { + encryption().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/AzureMachineLearningWorkspacesBuilder.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java similarity index 71% rename from sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java rename to sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java index 018c1d288b6ac..48795f9c5d6cf 100644 --- 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/AzureMachineLearningServicesBuilder.java @@ -14,9 +14,9 @@ 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 { +/** 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. */ @@ -26,9 +26,9 @@ public final class AzureMachineLearningWorkspacesBuilder { * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder subscriptionId(String subscriptionId) { + public AzureMachineLearningServicesBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -42,9 +42,9 @@ public AzureMachineLearningWorkspacesBuilder subscriptionId(String subscriptionI * Sets server parameter. * * @param endpoint the endpoint value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder endpoint(String endpoint) { + public AzureMachineLearningServicesBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -58,9 +58,9 @@ public AzureMachineLearningWorkspacesBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder environment(AzureEnvironment environment) { + public AzureMachineLearningServicesBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -74,9 +74,9 @@ public AzureMachineLearningWorkspacesBuilder environment(AzureEnvironment enviro * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder pipeline(HttpPipeline pipeline) { + public AzureMachineLearningServicesBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -90,9 +90,9 @@ public AzureMachineLearningWorkspacesBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder defaultPollInterval(Duration defaultPollInterval) { + public AzureMachineLearningServicesBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -106,19 +106,19 @@ public AzureMachineLearningWorkspacesBuilder defaultPollInterval(Duration defaul * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the AzureMachineLearningWorkspacesBuilder. + * @return the AzureMachineLearningServicesBuilder. */ - public AzureMachineLearningWorkspacesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public AzureMachineLearningServicesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of AzureMachineLearningWorkspacesImpl with the provided parameters. + * Builds an instance of AzureMachineLearningServicesImpl with the provided parameters. * - * @return an instance of AzureMachineLearningWorkspacesImpl. + * @return an instance of AzureMachineLearningServicesImpl. */ - public AzureMachineLearningWorkspacesImpl buildClient() { + public AzureMachineLearningServicesImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = @@ -131,8 +131,8 @@ public AzureMachineLearningWorkspacesImpl buildClient() { (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureMachineLearningWorkspacesImpl client = - new AzureMachineLearningWorkspacesImpl( + AzureMachineLearningServicesImpl client = + new AzureMachineLearningServicesImpl( localPipeline, localSerializerAdapter, localDefaultPollInterval, 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/AzureMachineLearningServicesImpl.java similarity index 78% rename from sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java rename to sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java index 242efe7553fdd..f4d745d8f1c77 100644 --- 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/AzureMachineLearningServicesImpl.java @@ -22,7 +22,7 @@ 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.AzureMachineLearningServices; import com.azure.resourcemanager.machinelearning.fluent.BatchDeploymentsClient; import com.azure.resourcemanager.machinelearning.fluent.BatchEndpointsClient; import com.azure.resourcemanager.machinelearning.fluent.CodeContainersClient; @@ -36,6 +36,7 @@ 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.LabelingJobsClient; import com.azure.resourcemanager.machinelearning.fluent.ModelContainersClient; import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.OnlineDeploymentsClient; @@ -44,6 +45,15 @@ 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.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; @@ -59,9 +69,9 @@ 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 { +/** 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; @@ -242,6 +252,102 @@ public WorkspaceConnectionsClient getWorkspaceConnections() { return this.workspaceConnections; } + /** 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 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; @@ -386,6 +492,18 @@ 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; @@ -446,6 +564,18 @@ 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; @@ -459,7 +589,7 @@ public WorkspaceFeaturesClient getWorkspaceFeatures() { } /** - * Initializes an instance of AzureMachineLearningWorkspaces client. + * 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. @@ -468,7 +598,7 @@ public WorkspaceFeaturesClient getWorkspaceFeatures() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - AzureMachineLearningWorkspacesImpl( + AzureMachineLearningServicesImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, @@ -480,7 +610,7 @@ public WorkspaceFeaturesClient getWorkspaceFeatures() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-10-01"; + this.apiVersion = "2022-12-01-preview"; this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.usages = new UsagesClientImpl(this); @@ -490,6 +620,14 @@ public WorkspaceFeaturesClient getWorkspaceFeatures() { this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.workspaceConnections = new WorkspaceConnectionsClientImpl(this); + this.registryCodeContainers = new RegistryCodeContainersClientImpl(this); + this.registryCodeVersions = new RegistryCodeVersionsClientImpl(this); + this.registryComponentContainers = new RegistryComponentContainersClientImpl(this); + this.registryComponentVersions = new RegistryComponentVersionsClientImpl(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); @@ -502,11 +640,13 @@ public WorkspaceFeaturesClient getWorkspaceFeatures() { this.environmentContainers = new EnvironmentContainersClientImpl(this); this.environmentVersions = new EnvironmentVersionsClientImpl(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); } @@ -650,5 +790,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(AzureMachineLearningWorkspacesImpl.class); + 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/BatchDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java index 05ce30e1ce977..1ce5a9a091501 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,26 +46,26 @@ 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") - private interface BatchDeploymentsService { + public interface BatchDeploymentsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 e980af5025e3f..fbe352e914661 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,26 +48,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface BatchEndpointsService { + public interface BatchEndpointsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 f6e833f49670e..e4b05a67278fb 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,26 +39,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface CodeContainersService { + public interface CodeContainersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..9401e4af4452d 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 @@ -49,16 +49,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 +66,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 +75,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 +94,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 +103,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 +113,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 +122,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,8 +132,8 @@ 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; } 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 83be807e0c2d6..520497710cae2 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 @@ -39,26 +39,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface CodeVersionsService { + public interface CodeVersionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..3118de08dfdac 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 @@ -79,136 +79,37 @@ 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))); - } - 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))); - } - 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 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; } - 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 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.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private CodeVersionsClient serviceClient() { @@ -218,8 +119,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 cd3ca5158110f..da1544c265771 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,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface ComponentContainersService { + public interface ComponentContainersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 bb5e311a001a0..6c2b5665e00a1 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,26 +40,26 @@ 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") - private interface ComponentVersionsService { + public interface ComponentVersionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..ee670a3949321 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 @@ -83,136 +83,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 +123,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..c1080c7b732cd 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,13 @@ 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.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 +181,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 +231,16 @@ 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 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 fda66e3c29476..1f207f92bbb1e 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 @@ -39,9 +39,12 @@ 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.UnderlyingResourceAction; import java.nio.ByteBuffer; +import java.util.List; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -51,25 +54,25 @@ 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") - private interface ComputesService { + public interface ComputesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" @@ -153,6 +156,23 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/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" @@ -233,6 +253,24 @@ 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("{nextLink}") @ExpectedResponses({200}) @@ -1586,6 +1624,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. * @@ -2702,6 +2923,189 @@ 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); + } + /** * 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..506de9fb011f2 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 @@ -16,7 +16,10 @@ 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.UnderlyingResourceAction; +import java.util.List; public final class ComputesImpl implements Computes { private static final ClientLogger LOGGER = new ClientLogger(ComputesImpl.class); @@ -84,6 +87,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 +161,22 @@ 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 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/DataContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java index abe2f24822b1c..d6b4579677a6d 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,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface DataContainersService { + public interface DataContainersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 fd7844ca6b353..1c9277a4471a5 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,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface DataVersionsService { + public interface DataVersionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 123132579e394..aba0a4c187de0 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,26 +44,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface DatastoresService { + public interface DatastoresService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 415688e0c9a98..a4fa60e05a56a 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,12 +55,12 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface EnvironmentContainersService { + public interface EnvironmentContainersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 7c565d20d62a3..d62be368cbdec 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,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface EnvironmentVersionsService { + public interface EnvironmentVersionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..99fe30b16861e 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 @@ -84,136 +84,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 +124,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/JobsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java index 919810a2f7381..d038ce83fa760 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 @@ -46,25 +46,25 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface JobsService { + public interface JobsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" @@ -81,6 +81,8 @@ Mono> list( @QueryParam("jobType") String jobType, @QueryParam("tag") String tag, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("scheduled") Boolean scheduled, + @QueryParam("scheduleId") String scheduleId, @HeaderParam("Accept") String accept, Context context); @@ -169,6 +171,8 @@ 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 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 +186,9 @@ private Mono> listSinglePageAsync( String skip, String jobType, String tag, - ListViewType listViewType) { + ListViewType listViewType, + Boolean scheduled, + String scheduleId) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -217,6 +223,8 @@ private Mono> listSinglePageAsync( jobType, tag, listViewType, + scheduled, + scheduleId, accept, context)) .>map( @@ -240,6 +248,8 @@ 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 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 +265,8 @@ private Mono> listSinglePageAsync( String jobType, String tag, ListViewType listViewType, + Boolean scheduled, + String scheduleId, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -288,6 +300,8 @@ private Mono> listSinglePageAsync( jobType, tag, listViewType, + scheduled, + scheduleId, accept, context) .map( @@ -310,6 +324,8 @@ 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 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 +338,13 @@ private PagedFlux listAsync( String skip, String jobType, String tag, - ListViewType listViewType) { + ListViewType listViewType, + Boolean scheduled, + String scheduleId) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType), + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, jobType, tag, listViewType, scheduled, scheduleId), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -344,8 +364,12 @@ private PagedFlux listAsync(String resourceGroupName, String works final String jobType = null; final String tag = null; final ListViewType listViewType = 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, scheduled, scheduleId), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -358,6 +382,8 @@ 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 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 +398,13 @@ private PagedFlux listAsync( String jobType, String tag, ListViewType listViewType, + Boolean scheduled, + String scheduleId, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context), + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, jobType, tag, listViewType, scheduled, scheduleId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -394,7 +424,10 @@ 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 Boolean scheduled = null; + final String scheduleId = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, scheduled, scheduleId)); } /** @@ -406,6 +439,8 @@ 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 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 +455,12 @@ public PagedIterable list( String jobType, String tag, ListViewType listViewType, + Boolean scheduled, + String scheduleId, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context)); + listAsync( + resourceGroupName, workspaceName, skip, jobType, tag, listViewType, scheduled, scheduleId, context)); } /** 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..ae2eaaa3d6061 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,14 @@ public PagedIterable list( String jobType, String tag, ListViewType listViewType, + 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, 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..08fdce27eb0a9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsClientImpl.java @@ -0,0 +1,1802 @@ +// Copyright (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 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 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 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 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 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 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/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 854ea80be2f8c..1c85201639f97 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,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface ModelContainersService { + public interface ModelContainersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..94e781ec77cfe 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 @@ -49,16 +49,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 +66,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 +75,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 +94,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 +103,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 +114,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 +123,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,8 +133,8 @@ 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; } 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 2babebd3f5dc8..6dcc3358aeb03 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 @@ -40,26 +40,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface ModelVersionsService { + public interface ModelVersionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..b24ff29b20722 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 @@ -103,136 +103,37 @@ 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))); - } - 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))); - } - 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 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; } - 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 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.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private ModelVersionsClient serviceClient() { @@ -242,8 +143,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/OnlineDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java index d8e1838637a7f..2679db358e74b 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,26 +51,26 @@ 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") - private interface OnlineDeploymentsService { + public interface OnlineDeploymentsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 27aadb6cef7de..46c8af39cdb4c 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,26 +52,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface OnlineEndpointsService { + public interface OnlineEndpointsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 a6e01f602a4ae..cbac0ff171c1a 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,26 +35,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.MachineLearningServices/operations") @ExpectedResponses({200}) @@ -67,7 +67,7 @@ Mono> list( } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -94,7 +94,7 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ private Mono> listSinglePageAsync(Context conte } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -134,7 +134,7 @@ private PagedFlux listAsync() { } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,7 +148,7 @@ private PagedFlux listAsync(Context context) { } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -161,7 +161,7 @@ public PagedIterable list() { } /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 6bdd7d096ba88..d9e87c51d78a1 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,12 +55,12 @@ 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") - private interface PrivateEndpointConnectionsService { + public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 0d3824890ef6a..d647a2eb77090 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 @@ -31,14 +31,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,12 +46,12 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface PrivateLinkResourcesService { + public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 2a3020669ac39..140a9d97d0257 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,25 +40,25 @@ 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") - private interface QuotasService { + public interface QuotasService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}" 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..c811fd9c94981 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java @@ -0,0 +1,1483 @@ +// Copyright (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.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.RegistriesUpdateResponse; +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, + @QueryParam("$skip") String skip, + @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, + @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}") + @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, 202}) + @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, 202}) + @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"}) + @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. + * + * @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 Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + 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 registries by 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 ManagementException 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(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skip, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List registries by subscription. + * + * @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 Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * 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() { + final String skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List registries by 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 ManagementException 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(String skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(skip, 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() { + final String skip = null; + return new PagedIterable<>(listAsync(skip)); + } + + /** + * List registries by 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 ManagementException 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(String skip, Context context) { + return new PagedIterable<>(listAsync(skip, context)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name 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 Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 registries. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + skip, + 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. + * @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 Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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) { + final String skip = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List registries. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, String skip, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, 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) { + final String skip = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip)); + } + + /** + * List registries. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, String skip, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip, context)); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of 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 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 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 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 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 beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of 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 beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 RegistriesUpdateResponse 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 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 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 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 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 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 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 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 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 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 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 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 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 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(); + } + + /** + * 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..0f8e040c928fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java @@ -0,0 +1,169 @@ +// Copyright (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(String skip, Context context) { + PagedIterable inner = this.serviceClient().list(skip, 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, String skip, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, skip, 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 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..07cb97028997e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java @@ -0,0 +1,1119 @@ +// Copyright (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. + * @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. + * @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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 beginDeleteAsync(resourceGroupName, registryName, codeName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 beginDeleteAsync(resourceGroupName, registryName, codeName, 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, 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. + * @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 beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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..47260adc8fad9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.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.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersionResourceArmPaginatedResult; +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"}) + @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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(); + } + + /** + * 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..2d20c7cb340d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.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.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersion; +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 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..8f04875552010 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java @@ -0,0 +1,1146 @@ +// Copyright (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. + * @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. + * @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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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..3950488e8426c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.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.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, + @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. + * @param componentName 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 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) { + 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, + 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. + * @param componentName 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 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, + 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, + 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. + * @param componentName 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 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) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, 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. + * @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; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, 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. + * @param componentName 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 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, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, 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. + * @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; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, componentName, 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. + * @param componentName 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 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, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, componentName, 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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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..d1f227a93e3fc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.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.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, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, componentName, orderBy, top, skip, 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/RegistryEnvironmentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java new file mode 100644 index 0000000000000..7f6ad5f2e642d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java @@ -0,0 +1,1168 @@ +// Copyright (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. + * @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. + * @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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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..854f3d52d987a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java @@ -0,0 +1,1330 @@ +// Copyright (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, + @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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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, + 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. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + 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, + 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return new PagedFlux<>( + () -> + listSinglePageAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, 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. + * @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; + return new PagedFlux<>( + () -> + listSinglePageAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, 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. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, registryName, environmentName, orderBy, top, skip, 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. + * @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; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, 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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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..81d93bafe1823 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java @@ -0,0 +1,233 @@ +// Copyright (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, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, 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..d2db904372a32 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java @@ -0,0 +1,242 @@ +// Copyright (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.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +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.RegistryProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.util.Collections; +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 RegistryProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 RegistryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RegistryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RegistryImpl withProperties(RegistryProperties properties) { + this.innerModel().withProperties(properties); + 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) { + if (isInCreateMode()) { + this.innerModel().withKind(kind); + return this; + } else { + this.updateBody.withKind(kind); + return this; + } + } + + public RegistryImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public RegistryImpl withIdentity(PartialManagedServiceIdentity identity) { + this.updateBody.withIdentity(identity); + return this; + } + + public RegistryImpl withProperties(Object properties) { + this.updateBody.withProperties(properties); + 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..f1a33935c4800 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java @@ -0,0 +1,1131 @@ +// Copyright (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. + * @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. + * @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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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..19ba803d196d1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java @@ -0,0 +1,1404 @@ +// Copyright (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.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; +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"}) + @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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 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. + * @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 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. + * @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. + * @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. + * @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. + * @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(); + } + + /** + * 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..68659c2f480ed --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java @@ -0,0 +1,245 @@ +// Copyright (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.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersion; +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 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 2bdb6e4ac113c..f2457d9df5f1a 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,26 +45,26 @@ 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") - private interface SchedulesService { + public interface SchedulesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 df6e64303009d..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,25 +36,25 @@ 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") - private interface UsagesService { + public interface UsagesService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") @ExpectedResponses({200}) 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 00dcb5a4924b6..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,26 +31,26 @@ 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}") @ServiceInterface(name = "AzureMachineLearning") - private interface VirtualMachineSizesService { + public interface VirtualMachineSizesService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") @ExpectedResponses({200}) 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 7e615f796a2de..6ac5fe82f0c5a 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 @@ -39,14 +39,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,12 +54,12 @@ 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") - private interface WorkspaceConnectionsService { + public interface WorkspaceConnectionsService { @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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 5c68a3ff89156..b6c359237d2c2 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,26 +36,26 @@ 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") - private interface WorkspaceFeaturesService { + public interface WorkspaceFeaturesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..a85561f4ac10e 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 @@ -14,6 +14,7 @@ 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.ListNotebookKeysResult; import com.azure.resourcemanager.machinelearning.models.ListStorageAccountKeysResult; import com.azure.resourcemanager.machinelearning.models.ListWorkspaceKeysResult; @@ -21,12 +22,12 @@ 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.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.WorkspaceProvisioningState; import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; import java.util.Collections; import java.util.List; @@ -107,7 +108,7 @@ public String discoveryUrl() { return this.innerModel().discoveryUrl(); } - public ProvisioningState provisioningState() { + public WorkspaceProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -195,6 +196,14 @@ public Boolean v1LegacyMode() { return this.innerModel().v1LegacyMode(); } + public String softDeletedAt() { + return this.innerModel().softDeletedAt(); + } + + public String scheduledPurgeDate() { + return this.innerModel().scheduledPurgeDate(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -522,6 +531,11 @@ public WorkspaceImpl withV1LegacyMode(Boolean v1LegacyMode) { return this; } + public WorkspaceImpl withEncryption(EncryptionUpdateProperties encryption) { + this.updateParameters.withEncryption(encryption); + 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/WorkspacePropertiesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java index e097ac2af75b8..67f583f1a6357 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 @@ -10,11 +10,11 @@ import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; 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.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.WorkspaceProperties; +import com.azure.resourcemanager.machinelearning.models.WorkspaceProvisioningState; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -63,7 +63,7 @@ public String discoveryUrl() { return this.innerModel().discoveryUrl(); } - public ProvisioningState provisioningState() { + public WorkspaceProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -151,6 +151,14 @@ public Boolean v1LegacyMode() { return this.innerModel().v1LegacyMode(); } + public String softDeletedAt() { + return this.innerModel().softDeletedAt(); + } + + public String scheduledPurgeDate() { + return this.innerModel().scheduledPurgeDate(); + } + public WorkspacePropertiesInner innerModel() { return this.innerObject; } 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 2b22626f01e71..7646ee419af80 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 @@ -55,26 +55,26 @@ 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") - private interface WorkspacesService { + public interface WorkspacesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" 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..a6d1684c51381 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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(String category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + 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/AcrDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java new file mode 100644 index 0000000000000..891afa4bad752 --- /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 { + /* + * The systemCreatedAcrAccount property. + */ + @JsonProperty(value = "systemCreatedAcrAccount") + private SystemCreatedAcrAccount systemCreatedAcrAccount; + + /* + * The userCreatedAcrAccount property. + */ + @JsonProperty(value = "userCreatedAcrAccount") + private UserCreatedAcrAccount userCreatedAcrAccount; + + /** Creates an instance of AcrDetails class. */ + public AcrDetails() { + } + + /** + * Get the systemCreatedAcrAccount property: The systemCreatedAcrAccount property. + * + * @return the systemCreatedAcrAccount value. + */ + public SystemCreatedAcrAccount systemCreatedAcrAccount() { + return this.systemCreatedAcrAccount; + } + + /** + * Set the systemCreatedAcrAccount property: The systemCreatedAcrAccount property. + * + * @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: The userCreatedAcrAccount property. + * + * @return the userCreatedAcrAccount value. + */ + public UserCreatedAcrAccount userCreatedAcrAccount() { + return this.userCreatedAcrAccount; + } + + /** + * Set the userCreatedAcrAccount property: The userCreatedAcrAccount property. + * + * @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/Aks.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java index e1f8238bd92c1..9bf5593b62ad2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java @@ -44,13 +44,6 @@ public Aks withProperties(AksSchemaProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public Aks withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public Aks withDescription(String description) { @@ -65,13 +58,6 @@ public Aks withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public Aks withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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/AmlCompute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java index e066172a41ae2..374d0d1059604 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java @@ -44,13 +44,6 @@ public AmlCompute withProperties(AmlComputeProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public AmlCompute withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public AmlCompute withDescription(String description) { @@ -65,13 +58,6 @@ public AmlCompute withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public AmlCompute withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..9cc37821c536e 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,7 @@ @Fluent public final class AmlOperationListResult { /* - * List of AML workspace operations supported by the AML workspace resource provider. + * List of AML operations supported by the AML resource provider. */ @JsonProperty(value = "value") private List value; @@ -23,7 +23,7 @@ public AmlOperationListResult() { } /** - * Get the value property: List of AML workspace operations supported by the AML workspace resource provider. + * Get the value property: List of AML operations supported by the AML resource provider. * * @return the value value. */ @@ -32,7 +32,7 @@ public List value() { } /** - * Set the value property: List of AML workspace operations supported by the AML workspace resource provider. + * Set the value property: List of AML operations supported by the AML 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/ArmResourceId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java new file mode 100644 index 0000000000000..f306ef8b8e558 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.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.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/AssetJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java index e6c3f9463eab9..171f479613eb6 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,18 @@ /** 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; + /* * Output Asset Delivery Mode. */ @@ -26,6 +38,46 @@ 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 mode property: Output Asset Delivery Mode. * 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..ef142945c474c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.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; + +/** 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 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/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/AzureBlobDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java index 24e0474c29dd5..183797f808304 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) { 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..76d00b8b12d0c 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) { 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..161847280db84 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) { 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/AzureFileDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java index af3f62739d13d..96e5e7f2681b4 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) { 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/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/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..e5c1ddcfb562f 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 @@ -74,13 +74,13 @@ 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. * @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 { 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..b221f6e6ece23 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 @@ -74,14 +74,14 @@ 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. + * @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 { 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..720f29ba13693 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,15 @@ 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 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..ed45eac7aa5dd 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 { @@ -107,55 +108,40 @@ Response getWithResponse( CodeVersion 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}. - */ - CodeVersion 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. 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}. - */ - 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, + CodeVersionInner 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. 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 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 azure Resource Manager resource envelope. */ - CodeVersion.DefinitionStages.Blank define(String name); + CodeVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body); } 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..51867e8cf1128 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. */ @@ -84,6 +90,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. * @@ -353,6 +381,9 @@ public CommandJob withTags(Map tags) { @Override public void validate() { super.validate(); + if (autologgerSettings() != null) { + autologgerSettings().validate(); + } if (command() == null) { throw LOGGER .logExceptionAsError( 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..54141e0594ac4 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 @@ -74,13 +74,13 @@ 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. * @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 { 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..450c6320f1ff6 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 @@ -74,14 +74,14 @@ 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. + * @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 { 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..387788d0b2b56 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,12 @@ 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; + /** Creates an instance of ComponentVersionProperties class. */ public ComponentVersionProperties() { } @@ -44,6 +50,15 @@ 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; + } + /** {@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..3ba3472d9399a 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 { @@ -109,55 +110,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/Compute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java index 1ed2a4317c3a8..ab18ca66332ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java @@ -37,14 +37,14 @@ public class Compute { /* * Location for the underlying compute */ - @JsonProperty(value = "computeLocation") + @JsonProperty(value = "computeLocation", access = JsonProperty.Access.WRITE_ONLY) private String computeLocation; /* * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private ComputeProvisioningState provisioningState; /* * The description of the Machine Learning compute. @@ -86,7 +86,7 @@ public class Compute { /* * Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. */ - @JsonProperty(value = "disableLocalAuth") + @JsonProperty(value = "disableLocalAuth", access = JsonProperty.Access.WRITE_ONLY) private Boolean disableLocalAuth; /** Creates an instance of Compute class. */ @@ -102,24 +102,13 @@ public String computeLocation() { return this.computeLocation; } - /** - * Set the computeLocation property: Location for the underlying compute. - * - * @param computeLocation the computeLocation value to set. - * @return the Compute object itself. - */ - public Compute withComputeLocation(String computeLocation) { - this.computeLocation = computeLocation; - return this; - } - /** * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, * Provisioning, Succeeded, and Failed. * * @return the provisioningState value. */ - public ProvisioningState provisioningState() { + public ComputeProvisioningState provisioningState() { return this.provisioningState; } @@ -210,18 +199,6 @@ public Boolean disableLocalAuth() { return this.disableLocalAuth; } - /** - * Set the disableLocalAuth property: Opt-out of local authentication and ensure customers can use only MSI and AAD - * exclusively for authentication. - * - * @param disableLocalAuth the disableLocalAuth value to set. - * @return the Compute object itself. - */ - public Compute withDisableLocalAuth(Boolean disableLocalAuth) { - this.disableLocalAuth = disableLocalAuth; - return this; - } - /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java index 3c1201eb45463..feb51a5e723d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java @@ -44,13 +44,6 @@ public ComputeInstance withProperties(ComputeInstanceProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public ComputeInstance withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public ComputeInstance withDescription(String description) { @@ -65,13 +58,6 @@ public ComputeInstance withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public ComputeInstance withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..d2b20dd6a22c9 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. */ @@ -104,6 +122,13 @@ public final class ComputeInstanceProperties { @JsonProperty(value = "schedules", access = JsonProperty.Access.WRITE_ONLY) 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 +235,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 +275,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. * @@ -361,6 +435,28 @@ public ComputeSchedules schedules() { return this.schedules; } + /** + * 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 +530,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/ComputePowerAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java index 81d51f75e516f..b94f5dd772949 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The compute power action. */ +/** [Required] The compute power action. */ public final class ComputePowerAction 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/ComputeProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeProvisioningState.java new file mode 100644 index 0000000000000..992c9e695c46c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeProvisioningState.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; + +/** The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. */ +public final class ComputeProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for ComputeProvisioningState. */ + public static final ComputeProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Updating for ComputeProvisioningState. */ + public static final ComputeProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for ComputeProvisioningState. */ + public static final ComputeProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ComputeProvisioningState. */ + public static final ComputeProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ComputeProvisioningState. */ + public static final ComputeProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ComputeProvisioningState. */ + public static final ComputeProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ComputeProvisioningState. */ + public static final ComputeProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ComputeProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeProvisioningState. + */ + @JsonCreator + public static ComputeProvisioningState fromString(String name) { + return fromString(name, ComputeProvisioningState.class); + } + + /** + * Gets known ComputeProvisioningState values. + * + * @return known ComputeProvisioningState values. + */ + public static Collection values() { + return values(ComputeProvisioningState.class); + } +} 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..307ce3debdb6e 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. */ @@ -261,6 +262,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 +380,26 @@ 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); } 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..4c4775150adee 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 @@ -35,22 +35,22 @@ public final class ComputeStartStopSchedule { private ComputePowerAction action; /* - * [Required] The schedule trigger type. + * The triggerType property. */ @JsonProperty(value = "triggerType") private TriggerType triggerType; /* - * Required if triggerType is Recurrence. + * The workflow trigger recurrence for ComputeStartStop schedule type. */ @JsonProperty(value = "recurrence") - private RecurrenceTrigger recurrence; + private Recurrence recurrence; /* - * Required if triggerType is Cron. + * The workflow trigger cron for ComputeStartStop schedule type. */ @JsonProperty(value = "cron") - private CronTrigger cron; + private Cron cron; /* * [Deprecated] Not used any more. @@ -121,7 +121,7 @@ public ComputeStartStopSchedule withAction(ComputePowerAction action) { } /** - * Get the triggerType property: [Required] The schedule trigger type. + * Get the triggerType property: The triggerType property. * * @return the triggerType value. */ @@ -130,7 +130,7 @@ public TriggerType triggerType() { } /** - * Set the triggerType property: [Required] The schedule trigger type. + * Set the triggerType property: The triggerType property. * * @param triggerType the triggerType value to set. * @return the ComputeStartStopSchedule object itself. @@ -141,41 +141,41 @@ public ComputeStartStopSchedule withTriggerType(TriggerType triggerType) { } /** - * Get the recurrence property: Required if triggerType is Recurrence. + * Get the recurrence property: The workflow trigger recurrence for ComputeStartStop schedule type. * * @return the recurrence value. */ - public RecurrenceTrigger recurrence() { + public Recurrence recurrence() { return this.recurrence; } /** - * Set the recurrence property: Required if triggerType is Recurrence. + * Set the recurrence property: The workflow trigger recurrence for ComputeStartStop schedule type. * * @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; } /** - * Get the cron property: Required if triggerType is Cron. + * Get the cron property: The workflow trigger cron for ComputeStartStop schedule type. * * @return the cron value. */ - public CronTrigger cron() { + public Cron cron() { return this.cron; } /** - * Set the cron property: Required if triggerType is Cron. + * Set the cron property: The workflow trigger cron for ComputeStartStop schedule type. * * @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..a3bb10d67abcd 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,40 @@ 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); + /** * 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 7acadfa990505..6bb133d7734e8 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,12 @@ public final class ConnectionAuthType extends ExpandableStringEnum { - /** Static value PythonFeed for ConnectionCategory. */ - public static final ConnectionCategory PYTHON_FEED = fromString("PythonFeed"); - - /** Static value ContainerRegistry for ConnectionCategory. */ - public static final ConnectionCategory CONTAINER_REGISTRY = fromString("ContainerRegistry"); - - /** Static value Git for ConnectionCategory. */ - public static final ConnectionCategory GIT = fromString("Git"); - - /** - * Creates or finds a ConnectionCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionCategory. - */ - @JsonCreator - public static ConnectionCategory fromString(String name) { - return fromString(name, ConnectionCategory.class); - } - - /** - * Gets known ConnectionCategory values. - * - * @return known ConnectionCategory values. - */ - public static Collection values() { - return values(ConnectionCategory.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java index 611b454eb6a41..cb63a9436a228 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ContainerType. */ +/** The type of container to retrieve logs from. */ public final class ContainerType 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 or finds a ContainerType from its string representation. * 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 c80fe61a647ba..a0f9b5455984a 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 or finds a CredentialsType from its string representation. * 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/CustomModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java index b68ea2621db98..474af2c7ce3e8 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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/DataFactory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java index 408de6370a324..0820935850205 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java @@ -17,13 +17,6 @@ public final class DataFactory extends Compute { public DataFactory() { } - /** {@inheritDoc} */ - @Override - public DataFactory withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public DataFactory withDescription(String description) { @@ -38,13 +31,6 @@ public DataFactory withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public DataFactory withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java index 93ab2b848c2d9..1401e08d0d666 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java @@ -44,13 +44,6 @@ public DataLakeAnalytics withProperties(DataLakeAnalyticsSchemaProperties proper return this; } - /** {@inheritDoc} */ - @Override - public DataLakeAnalytics withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public DataLakeAnalytics withDescription(String description) { @@ -65,13 +58,6 @@ public DataLakeAnalytics withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public DataLakeAnalytics withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..0e203b0b07e82 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 @@ -27,8 +27,7 @@ @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; @@ -38,8 +37,7 @@ 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 +46,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. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java index a0f94b61afd0e..5f90a2ae3083c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java @@ -44,13 +44,6 @@ public Databricks withProperties(DatabricksProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public Databricks withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public Databricks withDescription(String description) { @@ -65,13 +58,6 @@ public Databricks withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public Databricks withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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/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..591308872d833 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,8 @@ @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) }) @Fluent public class DatastoreProperties extends ResourceBase { 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 196716133c51a..818fab8da747e 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,9 @@ 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"); + /** * Creates or finds a DatastoreType from its string representation. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.java new file mode 100644 index 0000000000000..20dd07aa42350 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.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.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 Docker model. */ +@Fluent +public final class Docker { + /* + * Indicate whether container shall run in privileged or non-privileged mode. + */ + @JsonProperty(value = "privileged") + private Boolean privileged; + + /* + * Dictionary of + */ + @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/EncryptionKeyVaultUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java new file mode 100644 index 0000000000000..8a6b1c3ea0500 --- /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 { + /* + * Key Vault uri to access the encryption key. + */ + @JsonProperty(value = "keyIdentifier", required = true) + private String keyIdentifier; + + /** Creates an instance of EncryptionKeyVaultUpdateProperties class. */ + public EncryptionKeyVaultUpdateProperties() { + } + + /** + * 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 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/EncryptionUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java new file mode 100644 index 0000000000000..7462c0c945b36 --- /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 { + /* + * Customer Key vault properties. + */ + @JsonProperty(value = "keyVaultProperties", required = true) + private EncryptionKeyVaultUpdateProperties keyVaultProperties; + + /** Creates an instance of EncryptionUpdateProperties class. */ + public EncryptionUpdateProperties() { + } + + /** + * Get the keyVaultProperties property: Customer Key vault properties. + * + * @return the keyVaultProperties value. + */ + public EncryptionKeyVaultUpdateProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Customer Key vault properties. + * + * @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/EnvironmentContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java index 0256e791b224a..68fe0efe8b746 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 @@ -74,13 +74,13 @@ 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. * @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 { 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..a2b0cdd87d6f6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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..bafdb6fe91843 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 @@ -74,14 +74,15 @@ 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. + * @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 { 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..8dba447c97510 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 @@ -62,6 +62,12 @@ public final class EnvironmentVersionProperties extends AssetBase { @JsonProperty(value = "osType") private OperatingSystemType osType; + /* + * Provisioning state for the environment version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of EnvironmentVersionProperties class. */ public EnvironmentVersionProperties() { } @@ -208,6 +214,15 @@ 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; + } + /** {@inheritDoc} */ @Override public EnvironmentVersionProperties withIsAnonymous(Boolean isAnonymous) { 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..a218e7031a0ce 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 { @@ -109,55 +110,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..758f507fb2c03 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportFormatType.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.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 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/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/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/HDInsight.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java index c5e63988ce745..a5558dca56478 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java @@ -44,13 +44,6 @@ public HDInsight withProperties(HDInsightProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public HDInsight withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public HDInsight withDescription(String description) { @@ -65,13 +58,6 @@ public HDInsight withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public HDInsight withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..24c6954ca887d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HdfsDatastore.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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/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..24528b787a385 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageAnnotationType.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.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 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..ce8a78506769b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + + /** 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; + } + + /** + * 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/ImageType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java new file mode 100644 index 0000000000000..c87850232d6db --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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/IncrementalDataRefresh.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IncrementalDataRefresh.java new file mode 100644 index 0000000000000..aa0f7d0067746 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IncrementalDataRefresh.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.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 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/JobBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java index 8a72ed8f844bc..be06da4409a19 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 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..85d5c4a5f8fdc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobProvisioningState.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 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 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/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 43808f2029b9c..053db5ab8f738 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 or finds a JobStatus from its string representation. * 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 7aa01c1c4d112..6dce981cd0779 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 or finds a JobType from its string representation. * 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..ca4e22b48f9b2 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,8 @@ 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 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 +46,8 @@ PagedIterable list( String jobType, String tag, ListViewType listViewType, + 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..ecdf2887888d5 --- /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", required = true) + 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..da085d1bed1f0 --- /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", required = true) + 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/Kubernetes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java index e5f2de0d139f2..2d81e05f6df9d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java @@ -44,13 +44,6 @@ public Kubernetes withProperties(KubernetesProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public Kubernetes withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public Kubernetes withDescription(String description) { @@ -65,13 +58,6 @@ public Kubernetes withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public Kubernetes withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..71f933b1e0d89 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJob.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.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..9fac93fd5cdee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobProperties.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.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 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/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..f57ace0f4d511 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationType.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.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 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..7434e50a0c3a9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowAutologgerState.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.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 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..4624f1de42417 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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..13fb23c947b6b 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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..7b7b3e95e5f76 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 @@ -47,7 +47,7 @@ public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCredentials( /** {@inheritDoc} */ @Override - public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCategory(String category) { super.withCategory(category); return this; } 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..80053dacfbae0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MediaType.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.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 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..1bf5a22f3d221 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MlflowAutologger.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.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 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/ModelContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java index 0841f457eef91..a8305c6c4dff2 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 @@ -74,13 +74,13 @@ 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. * @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 { 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/ModelVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java index 6d8d49f169842..bae47c6d02968 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 @@ -74,14 +74,14 @@ 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. + * @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 { 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..af99322cdfbfd 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 @@ -37,6 +37,12 @@ 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; + /** Creates an instance of ModelVersionProperties class. */ public ModelVersionProperties() { } @@ -121,6 +127,15 @@ 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; + } + /** {@inheritDoc} */ @Override public ModelVersionProperties withIsAnonymous(Boolean isAnonymous) { 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..87b2048dd9f8c 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 { @@ -121,55 +122,40 @@ Response getWithResponse( ModelVersion 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}. - */ - ModelVersion 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. 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}. */ - 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); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + ModelVersionInner 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. 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 Response}. - */ - 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. + * @return azure Resource Manager resource envelope. */ - ModelVersion.DefinitionStages.Blank define(String name); + ModelVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body); } 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..551e2d29180e5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MultiSelect.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.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 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..3c0ac2d5d66a1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpLearningRateScheduler.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 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 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..68fcdfd580683 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.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.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 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..07ce4a6309355 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 @@ -19,7 +19,7 @@ public NoneAuthTypeWorkspaceConnectionProperties() { /** {@inheritDoc} */ @Override - public NoneAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + public NoneAuthTypeWorkspaceConnectionProperties withCategory(String category) { super.withCategory(category); return this; } 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/Operations.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java index d718ecc7e6d5b..8a1fe4495a715 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java @@ -10,7 +10,7 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -20,7 +20,7 @@ public interface Operations { PagedIterable list(); /** - * Lists all of the available Azure Machine Learning Workspaces REST API operations. + * Lists all of the available Azure Machine Learning Services REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 815418c33ba28..1a256af14434a 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 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 PartialManagedServiceIdentity 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(PartialManagedServiceIdentity 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 PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the properties property: Additional attributes of the entity. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withProperties(Object properties) { + this.properties = properties; + 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..d4665991c1128 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 @@ -47,7 +47,7 @@ public PatAuthTypeWorkspaceConnectionProperties withCredentials( /** {@inheritDoc} */ @Override - public PatAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + public PatAuthTypeWorkspaceConnectionProperties withCategory(String category) { super.withCategory(category); 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/Protocol.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java new file mode 100644 index 0000000000000..486388328b856 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.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; + +/** + * 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 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 deleted file mode 100644 index a24e2d48fa522..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -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. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Unknown for ProvisioningState. */ - public static final ProvisioningState UNKNOWN = fromString("Unknown"); - - /** Static value Updating for ProvisioningState. */ - public static final ProvisioningState UPDATING = fromString("Updating"); - - /** Static value Creating for ProvisioningState. */ - public static final ProvisioningState CREATING = fromString("Creating"); - - /** Static value Deleting for ProvisioningState. */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} 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/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..03631fc038007 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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 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 Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String skip, 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 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 Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of 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 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 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 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); + + /** + * 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/RegistriesUpdateHeaders.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistriesUpdateHeaders.java new file mode 100644 index 0000000000000..9743d560679d3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistriesUpdateHeaders.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.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegistriesUpdateHeaders model. */ +@Fluent +public final class RegistriesUpdateHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of RegistriesUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public RegistriesUpdateHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the RegistriesUpdateHeaders object itself. + */ + public RegistriesUpdateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the RegistriesUpdateHeaders object itself. + */ + public RegistriesUpdateHeaders withLocation(String location) { + this.location = location; + 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/RegistriesUpdateResponse.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistriesUpdateResponse.java new file mode 100644 index 0000000000000..43bc360f79b48 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistriesUpdateResponse.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.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; + +/** Contains all response data for the update operation. */ +public final class RegistriesUpdateResponse extends ResponseBase { + /** + * Creates an instance of RegistriesUpdateResponse. + * + * @param request the request which resulted in this RegistriesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegistriesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + RegistryInner value, + RegistriesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public RegistryInner getValue() { + return super.getValue(); + } +} 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..9504f9e9ce411 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + RegistryProperties properties(); + + /** + * 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 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.WithProperties, + 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. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Registry 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(RegistryProperties properties); + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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.WithKind, + UpdateStages.WithProperties, + 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(PartialManagedServiceIdentity identity); + } + /** The stage of the Registry update 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. + */ + Update withKind(String kind); + } + /** The stage of the Registry update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Additional attributes of the entity.. + * + * @param properties Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(Object properties); + } + /** 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); +} 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..a75997d618ff1 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. + * @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 container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, 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. + * @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 container. + */ + CodeContainer get(String resourceGroupName, String registryName, String codeName); + + /** + * 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. + * + * @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 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..1953b08096235 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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); + + /** + * 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..2dab6a39e255f --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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..b048d2cccb176 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights 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. + * @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. + * @param componentName 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 ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String componentName, + 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. + * @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. + * @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. + * @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. + * @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/RegistryEnvironmentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java new file mode 100644 index 0000000000000..9f5183aa3c022 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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..3e2b74488f7b2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.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 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. + * @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. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, + 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. + * @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. + * @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. + * @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. + * @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/RegistryModelContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java new file mode 100644 index 0000000000000..298447a4bd750 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @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. + * @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. + * @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. + * @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. + * @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..f50489f49f097 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights 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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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); + + /** + * 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/RegistryProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryProperties.java new file mode 100644 index 0000000000000..18440950ded38 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryProperties.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +/** Details of the Registry. */ +@Fluent +public final class RegistryProperties extends ResourceBase { + /* + * The publicNetworkAccess property. + */ + @JsonProperty(value = "publicNetworkAccess") + private String publicNetworkAccess; + + /* + * The discoveryUrl property. + */ + @JsonProperty(value = "discoveryUrl") + private String discoveryUrl; + + /* + * The intellectualPropertyPublisher property. + */ + @JsonProperty(value = "intellectualPropertyPublisher") + private String intellectualPropertyPublisher; + + /* + * Managed resource group created for the registry + */ + @JsonProperty(value = "managedResourceGroup") + private ArmResourceId managedResourceGroup; + + /* + * The mlFlowRegistryUri property. + */ + @JsonProperty(value = "mlFlowRegistryUri") + private String mlFlowRegistryUri; + + /* + * The privateLinkCount property. + */ + @JsonProperty(value = "privateLinkCount") + private Integer privateLinkCount; + + /* + * Details of each region the registry is in + */ + @JsonProperty(value = "regionDetails") + private List regionDetails; + + /** Creates an instance of RegistryProperties class. */ + public RegistryProperties() { + } + + /** + * Get the publicNetworkAccess property: The publicNetworkAccess property. + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: The publicNetworkAccess property. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPublicNetworkAccess(String publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the discoveryUrl property: The discoveryUrl property. + * + * @return the discoveryUrl value. + */ + public String discoveryUrl() { + return this.discoveryUrl; + } + + /** + * Set the discoveryUrl property: The discoveryUrl property. + * + * @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: The intellectualPropertyPublisher property. + * + * @return the intellectualPropertyPublisher value. + */ + public String intellectualPropertyPublisher() { + return this.intellectualPropertyPublisher; + } + + /** + * Set the intellectualPropertyPublisher property: The intellectualPropertyPublisher property. + * + * @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: Managed resource group created for the registry. + * + * @return the managedResourceGroup value. + */ + public ArmResourceId managedResourceGroup() { + return this.managedResourceGroup; + } + + /** + * Set the managedResourceGroup property: Managed resource group created for the registry. + * + * @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: The mlFlowRegistryUri property. + * + * @return the mlFlowRegistryUri value. + */ + public String mlFlowRegistryUri() { + return this.mlFlowRegistryUri; + } + + /** + * Set the mlFlowRegistryUri property: The mlFlowRegistryUri property. + * + * @param mlFlowRegistryUri the mlFlowRegistryUri value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withMlFlowRegistryUri(String mlFlowRegistryUri) { + this.mlFlowRegistryUri = mlFlowRegistryUri; + return this; + } + + /** + * Get the privateLinkCount property: The privateLinkCount property. + * + * @return the privateLinkCount value. + */ + public Integer privateLinkCount() { + return this.privateLinkCount; + } + + /** + * Set the privateLinkCount property: The privateLinkCount property. + * + * @param privateLinkCount the privateLinkCount value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPrivateLinkCount(Integer privateLinkCount) { + this.privateLinkCount = privateLinkCount; + 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; + } + + /** {@inheritDoc} */ + @Override + public RegistryProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryProperties 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 (managedResourceGroup() != null) { + managedResourceGroup().validate(); + } + if (regionDetails() != null) { + regionDetails().forEach(e -> e.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/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/SasAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java index 1065fa7947c69..5a2e80c7be3a2 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 @@ -47,7 +47,7 @@ public SasAuthTypeWorkspaceConnectionProperties withCredentials( /** {@inheritDoc} */ @Override - public SasAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + public SasAuthTypeWorkspaceConnectionProperties withCategory(String category) { super.withCategory(category); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java index 8c7ad3d4aa8a7..6ba8ea7e31fe7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java @@ -11,7 +11,7 @@ @Fluent public final class ScriptReference { /* - * The storage source of the script: workspace. + * The storage source of the script: inline, workspace. */ @JsonProperty(value = "scriptSource") private String scriptSource; @@ -39,7 +39,7 @@ public ScriptReference() { } /** - * Get the scriptSource property: The storage source of the script: workspace. + * Get the scriptSource property: The storage source of the script: inline, workspace. * * @return the scriptSource value. */ @@ -48,7 +48,7 @@ public String scriptSource() { } /** - * Set the scriptSource property: The storage source of the script: workspace. + * Set the scriptSource property: The storage source of the script: inline, workspace. * * @param scriptSource the scriptSource value to set. * @return the ScriptReference object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java index e5c8f73e7d466..7b163803317cb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java @@ -22,6 +22,12 @@ public final class SecretsType 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 or finds a SecretsType from its string representation. * 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..0241dc40358ed --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.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; + +/** 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(String category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + 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/SparkJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java new file mode 100644 index 0000000000000..84cf8c51e3f21 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + + /* + * 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 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 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 (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..ad09175be85d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.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.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 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/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..f4b3a8214d7d8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessageLevel.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.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 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..06d3ea89bd473 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.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.fasterxml.jackson.annotation.JsonProperty; + +/** Details of storage account to be used for the Registry. */ +@Fluent +public final class StorageAccountDetails { + /* + * The systemCreatedStorageAccount property. + */ + @JsonProperty(value = "systemCreatedStorageAccount") + private SystemCreatedStorageAccount systemCreatedStorageAccount; + + /* + * The userCreatedStorageAccount property. + */ + @JsonProperty(value = "userCreatedStorageAccount") + private UserCreatedStorageAccount userCreatedStorageAccount; + + /** Creates an instance of StorageAccountDetails class. */ + public StorageAccountDetails() { + } + + /** + * Get the systemCreatedStorageAccount property: The systemCreatedStorageAccount property. + * + * @return the systemCreatedStorageAccount value. + */ + public SystemCreatedStorageAccount systemCreatedStorageAccount() { + return this.systemCreatedStorageAccount; + } + + /** + * Set the systemCreatedStorageAccount property: The systemCreatedStorageAccount property. + * + * @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: The userCreatedStorageAccount property. + * + * @return the userCreatedStorageAccount value. + */ + public UserCreatedStorageAccount userCreatedStorageAccount() { + return this.userCreatedStorageAccount; + } + + /** + * Set the userCreatedStorageAccount property: The userCreatedStorageAccount property. + * + * @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/SynapseSpark.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java index 287f483c99310..92f5757fee5bb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java @@ -44,13 +44,6 @@ public SynapseSpark withProperties(SynapseSparkProperties properties) { return this; } - /** {@inheritDoc} */ - @Override - public SynapseSpark withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public SynapseSpark withDescription(String description) { @@ -65,13 +58,6 @@ public SynapseSpark withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public SynapseSpark withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..8d402f93b4625 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SystemCreatedAcrAccount model. */ +@Fluent +public final class SystemCreatedAcrAccount { + /* + * The acrAccountSku property. + */ + @JsonProperty(value = "acrAccountSku") + private String acrAccountSku; + + /* + * ARM ResourceId of a resource + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /** Creates an instance of SystemCreatedAcrAccount class. */ + public SystemCreatedAcrAccount() { + } + + /** + * Get the acrAccountSku property: The acrAccountSku property. + * + * @return the acrAccountSku value. + */ + public String acrAccountSku() { + return this.acrAccountSku; + } + + /** + * Set the acrAccountSku property: The acrAccountSku property. + * + * @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: 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 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..6e356e889dc5e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.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.JsonProperty; + +/** The SystemCreatedStorageAccount model. */ +@Fluent +public final class SystemCreatedStorageAccount { + /* + * ARM ResourceId of a resource + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /* + * The storageAccountHnsEnabled property. + */ + @JsonProperty(value = "storageAccountHnsEnabled") + private Boolean storageAccountHnsEnabled; + + /* + * Allowed values: + * "Standard_LRS", + * "Standard_GRS", + * "Standard_RAGRS", + * "Standard_ZRS", + * "Standard_GZRS", + * "Standard_RAGZRS", + * "Premium_LRS", + * "Premium_ZRS" + */ + @JsonProperty(value = "storageAccountType") + private String storageAccountType; + + /* + * The allowBlobPublicAccess property. + */ + @JsonProperty(value = "allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** Creates an instance of SystemCreatedStorageAccount class. */ + public SystemCreatedStorageAccount() { + } + + /** + * 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 SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Get the storageAccountHnsEnabled property: The storageAccountHnsEnabled property. + * + * @return the storageAccountHnsEnabled value. + */ + public Boolean storageAccountHnsEnabled() { + return this.storageAccountHnsEnabled; + } + + /** + * Set the storageAccountHnsEnabled property: The storageAccountHnsEnabled property. + * + * @param storageAccountHnsEnabled the storageAccountHnsEnabled value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountHnsEnabled(Boolean storageAccountHnsEnabled) { + this.storageAccountHnsEnabled = storageAccountHnsEnabled; + 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; + } + + /** + * Get the allowBlobPublicAccess property: The allowBlobPublicAccess property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: The allowBlobPublicAccess property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + 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..f9ae2c5a25132 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextAnnotationType.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.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 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/TrainingMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingMode.java new file mode 100644 index 0000000000000..d10bd99dc3689 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingMode.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.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 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/TriggerBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java index b7180fe49f25d..acb387b33a956 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java @@ -18,8 +18,8 @@ defaultImpl = TriggerBase.class) @JsonTypeName("TriggerBase") @JsonSubTypes({ - @JsonSubTypes.Type(name = "Recurrence", value = RecurrenceTrigger.class), - @JsonSubTypes.Type(name = "Cron", value = CronTrigger.class) + @JsonSubTypes.Type(name = "Cron", value = CronTrigger.class), + @JsonSubTypes.Type(name = "Recurrence", value = RecurrenceTrigger.class) }) @Fluent public class TriggerBase { 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..83c448a863bd4 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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..74079e0e1160f 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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..6868418cd37b0 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,18 @@ @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; + /* * Output Asset Delivery Mode. */ @@ -30,6 +42,46 @@ 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 mode property: Output Asset Delivery Mode. * 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/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java index c63b03a2f6017..1948bc6a69dc3 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 @@ -47,7 +47,7 @@ public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCredentials( /** {@inheritDoc} */ @Override - public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCategory(String category) { super.withCategory(category); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java index ace46f7abc11d..570da51e7a55a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java @@ -44,13 +44,6 @@ public VirtualMachine withProperties(VirtualMachineSchemaProperties properties) return this; } - /** {@inheritDoc} */ - @Override - public VirtualMachine withComputeLocation(String computeLocation) { - super.withComputeLocation(computeLocation); - return this; - } - /** {@inheritDoc} */ @Override public VirtualMachine withDescription(String description) { @@ -65,13 +58,6 @@ public VirtualMachine withResourceId(String resourceId) { return this; } - /** {@inheritDoc} */ - @Override - public VirtualMachine withDisableLocalAuth(Boolean disableLocalAuth) { - super.withDisableLocalAuth(disableLocalAuth); - return this; - } - /** * Validates the instance. * 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..c69699b1eaf18 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.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 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 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/Workspace.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java index 42e253da0269e..a5aa4b348c098 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 @@ -135,7 +135,7 @@ public interface Workspace { * * @return the provisioningState value. */ - ProvisioningState provisioningState(); + WorkspaceProvisioningState provisioningState(); /** * Gets the encryption property: The encryption settings of Azure ML workspace. @@ -256,6 +256,20 @@ public interface Workspace { */ Boolean v1LegacyMode(); + /** + * Gets the softDeletedAt property: The timestamp when the workspace was soft deleted. + * + * @return the softDeletedAt value. + */ + String softDeletedAt(); + + /** + * Gets the scheduledPurgeDate property: The timestamp when the soft deleted workspace is going to be purged. + * + * @return the scheduledPurgeDate value. + */ + String scheduledPurgeDate(); + /** * Gets the region of the resource. * @@ -588,7 +602,8 @@ interface Update UpdateStages.WithPrimaryUserAssignedIdentity, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithApplicationInsights, - UpdateStages.WithContainerRegistry { + UpdateStages.WithContainerRegistry, + UpdateStages.WithEncryption { /** * Executes the update request. * @@ -720,6 +735,16 @@ interface WithContainerRegistry { */ Update withContainerRegistry(String containerRegistry); } + /** The stage of the Workspace update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings of the workspace.. + * + * @param encryption The encryption settings of the workspace. + * @return the next definition stage. + */ + Update withEncryption(EncryptionUpdateProperties encryption); + } } /** * Refreshes the resource to sync with Azure. 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/WorkspaceConnectionPropertiesV2.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java index a0a871c9c248b..c2260c423eb8f 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 @@ -21,6 +21,8 @@ @JsonSubTypes.Type(name = "PAT", value = PatAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "SAS", value = SasAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "UsernamePassword", value = UsernamePasswordAuthTypeWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "AccessKey", value = AccessKeyAuthTypeWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "None", value = NoneAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "ManagedIdentity", value = ManagedIdentityAuthTypeWorkspaceConnectionProperties.class) }) @@ -30,7 +32,7 @@ public class WorkspaceConnectionPropertiesV2 { * Category of the connection */ @JsonProperty(value = "category") - private ConnectionCategory category; + private String category; /* * The target property. @@ -59,7 +61,7 @@ public WorkspaceConnectionPropertiesV2() { * * @return the category value. */ - public ConnectionCategory category() { + public String category() { return this.category; } @@ -69,7 +71,7 @@ public ConnectionCategory category() { * @param category the category value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ - public WorkspaceConnectionPropertiesV2 withCategory(ConnectionCategory category) { + public WorkspaceConnectionPropertiesV2 withCategory(String category) { this.category = category; return this; } 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/WorkspaceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java index 41e6d8c3f5a00..d930bcac47b5b 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 @@ -74,7 +74,7 @@ public interface WorkspaceProperties { * * @return the provisioningState value. */ - ProvisioningState provisioningState(); + WorkspaceProvisioningState provisioningState(); /** * Gets the encryption property: The encryption settings of Azure ML workspace. @@ -195,6 +195,20 @@ public interface WorkspaceProperties { */ Boolean v1LegacyMode(); + /** + * Gets the softDeletedAt property: The timestamp when the workspace was soft deleted. + * + * @return the softDeletedAt value. + */ + String softDeletedAt(); + + /** + * Gets the scheduledPurgeDate property: The timestamp when the soft deleted workspace is going to be purged. + * + * @return the scheduledPurgeDate value. + */ + String scheduledPurgeDate(); + /** * 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/WorkspaceProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProvisioningState.java new file mode 100644 index 0000000000000..16cb87ce6aee8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProvisioningState.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; + +/** + * The current deployment state of workspace resource. The provisioningState is to indicate states for resource + * provisioning. + */ +public final class WorkspaceProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Updating for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value SoftDeleted for WorkspaceProvisioningState. */ + public static final WorkspaceProvisioningState SOFT_DELETED = fromString("SoftDeleted"); + + /** + * Creates or finds a WorkspaceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceProvisioningState. + */ + @JsonCreator + public static WorkspaceProvisioningState fromString(String name) { + return fromString(name, WorkspaceProvisioningState.class); + } + + /** + * Gets known WorkspaceProvisioningState values. + * + * @return known WorkspaceProvisioningState values. + */ + public static Collection values() { + return values(WorkspaceProvisioningState.class); + } +} 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..48762a228fcf6 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 @@ -298,6 +298,29 @@ public WorkspaceUpdateParameters withContainerRegistry(String containerRegistry) return this; } + /** + * Get the encryption property: The encryption settings of the workspace. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption settings of the workspace. + * + * @param encryption the encryption value to set. + * @return the WorkspaceUpdateParameters object itself. + */ + public WorkspaceUpdateParameters withEncryption(EncryptionUpdateProperties encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + /** * Validates the instance. * 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..6430e2bbc2743 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/2022-12-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 ecd4e1b9dbe13..b1f9cab9e10d3 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 @@ -9,14 +9,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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", Context.NONE); 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 df461725f1959..6cdf547d2dbcd 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 @@ -9,14 +9,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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", Context.NONE); 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 7c75da82514c9..c6f50795a06bc 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 @@ -9,14 +9,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/2022-12-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("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, Context.NONE); 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 33cc7e585b51d..8b02b91be05a1 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 @@ -13,14 +13,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/2022-12-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..89394e7f105c0 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/2022-12-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 14687d5965225..281f8490b2235 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 @@ -9,14 +9,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/2022-12-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", 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 3535105d5877f..6a7c51c739e9c 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 @@ -9,14 +9,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/2022-12-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", 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 3ac7d187e72d4..d0f332c4ed8c3 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 @@ -9,14 +9,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/2022-12-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", 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 0a9ce24c8c079..a38d3fb62d532 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 @@ -9,14 +9,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/2022-12-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, 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 2e0ce937045c2..3f6d5fd6f9c66 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 @@ -17,15 +17,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/2022-12-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..46d922f125fcd 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +13,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/2022-12-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"))), + 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 b41d8f21484e1..8a77a6ba1637f 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 @@ -9,14 +9,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/2022-12-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", 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 03916db356ad9..ec5cce16ff93a 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 @@ -9,14 +9,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/2022-12-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", 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 7a734f50fb67b..7b31ccff37839 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 @@ -9,14 +9,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/2022-12-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, 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..dfd351952c3fa 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +13,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/2022-12-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")), + 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 5df55ae42fdc7..67df5f0548ff5 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 @@ -9,14 +9,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/2022-12-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", 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 d8282811c5e5f..f1c34c4abd478 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 @@ -9,14 +9,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/2022-12-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", 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 d08e2a6516921..4693a2536ae9d 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 @@ -9,14 +9,15 @@ /** 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/2022-12-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, 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..5163794052228 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +13,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/2022-12-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"))), + 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 84a08c68853c1..2281ee0534ab0 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 @@ -9,14 +9,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/2022-12-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().deleteWithResponse("test-rg", "my-aml-workspace", "string", Context.NONE); } 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 9c3b27ccafb28..95324470c8e6e 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 @@ -9,14 +9,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/2022-12-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", 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 eed238b55e621..cfb95c2f22942 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 @@ -9,14 +9,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/2022-12-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, 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..2002d5f75d038 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 @@ -5,7 +5,9 @@ package com.azure.resourcemanager.machinelearning.generated; import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; 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 +16,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/2022-12-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))), + 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 fe39d2b32cbe6..d8d612d3ac1b9 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 @@ -9,14 +9,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/2022-12-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().deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", Context.NONE); } 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 bfcca8f56b548..1241e6ce8bcf5 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 @@ -9,14 +9,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/2022-12-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", 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 0c814fc791d7b..95819fd0bf77e 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 @@ -9,14 +9,15 @@ /** 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/2022-12-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, 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..67bfbfc2e3e9b 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,42 @@ 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.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.SshPublicAccess; 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/2022-12-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. @@ -52,7 +65,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/2022-12-01-preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. @@ -75,7 +88,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/2022-12-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. @@ -112,7 +125,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. @@ -145,7 +158,7 @@ public static void createAnComputeInstanceComputeWithSchedules( } /* - * 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/2022-12-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. @@ -181,7 +194,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. @@ -202,8 +215,46 @@ 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) .withPersonalComputeInstanceSettings( new PersonalComputeInstanceSettings() @@ -215,7 +266,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/2022-12-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. @@ -235,7 +286,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/2022-12-01-preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. @@ -262,7 +313,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/2022-12-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 630713c71c04a..aa6362b304504 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 @@ -10,7 +10,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/2022-12-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 059145d265d21..6a362eaecae4c 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 @@ -9,7 +9,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/2022-12-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/2022-12-01-preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. @@ -33,7 +33,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/2022-12-01-preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. @@ -45,7 +45,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/2022-12-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 03970ea4ca620..63df5cb594f35 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 @@ -9,7 +9,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/2022-12-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 359df0cac84c2..096cdcd743075 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 @@ -9,7 +9,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/2022-12-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 ef996e45f5003..3db370c3568c1 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 @@ -9,7 +9,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/2022-12-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/ComputeRestartSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java index 75f5badd6731b..1267b797e675c 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 @@ -9,7 +9,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/2022-12-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 b3515b60d9086..a47b0772691d8 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 @@ -9,7 +9,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/2022-12-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 c5066d71939ff..fc47ba6d2563d 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 @@ -9,7 +9,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/2022-12-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..561932447aa5e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateCustomServicesSamples.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.generated; + +import com.azure.core.util.Context; +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/2022-12-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())), + 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..2cd92c99b4a08 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateIdleShutdownSettingSamples.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; + +import com.azure.core.util.Context; +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/2022-12-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"), + 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 4d86b2bb31fd1..6b2c0937c5457 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 @@ -13,7 +13,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/2022-12-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..3641244ccbc67 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 @@ -12,14 +12,14 @@ /** 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/2022-12-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() 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 e9b94e43ad40f..d5e3530deabd0 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 @@ -9,14 +9,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/2022-12-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", 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 8e356f21c72f1..be7c64cd20304 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 @@ -9,14 +9,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/2022-12-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", 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 d0f2391a28d44..4b99d8cfdaa1c 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 @@ -9,14 +9,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/2022-12-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, 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..01e55354939c5 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 @@ -11,14 +11,14 @@ /** 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/2022-12-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() 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 bd140c195cab4..beb2f9984f39d 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 @@ -9,14 +9,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/2022-12-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", 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 60692d9973201..6d8c385bffd74 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 @@ -9,14 +9,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/2022-12-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", 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 d0337268d4f88..9650ba1436905 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 @@ -9,14 +9,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/2022-12-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("test-rg", "my-aml-workspace", "string", "string", 1, null, "string", null, 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..46e5516c3140d 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/2022-12-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/2022-12-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/2022-12-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/2022-12-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 f7af24ed2c529..5af7c73418d9e 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 @@ -9,7 +9,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/2022-12-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 f0ad867989cfd..56f4db855a8f0 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 @@ -9,7 +9,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/2022-12-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 4d279b54fde56..36b8d3eb7f1c8 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 @@ -10,7 +10,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/2022-12-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 91304856d2f14..fef65bd61c2dd 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 @@ -9,7 +9,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/2022-12-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..eb169f41993f8 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +13,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/2022-12-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"))), + 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 368e9dec27fb7..b80db33d79c11 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 @@ -9,14 +9,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/2022-12-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().deleteWithResponse("testrg123", "testworkspace", "testContainer", Context.NONE); } 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 5bd93375cf82a..a88aeb54dbd26 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 @@ -9,14 +9,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/2022-12-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().getWithResponse("testrg123", "testworkspace", "testEnvironment", Context.NONE); } 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 1d8fa6404f578..763ea4d377bb8 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 @@ -9,14 +9,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/2022-12-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().list("testrg123", "testworkspace", null, null, Context.NONE); } 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..fd63f615c0ef9 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +16,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/2022-12-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)))), + 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 ddfb81e8a9c15..1ebe91dede6f6 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 @@ -9,14 +9,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/2022-12-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 bde4654cd314b..8ad9ace3ca11f 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 @@ -9,14 +9,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/2022-12-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", 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 e78314c91c808..2fd05f70c9360 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 @@ -9,14 +9,14 @@ /** 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/2022-12-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() 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 a5df4ac7d36a5..e4c0b6646fe5f 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 @@ -9,7 +9,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/2022-12-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..7f937eab3bcca 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 @@ -8,6 +8,7 @@ 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.AutologgerSettings; import com.azure.resourcemanager.machinelearning.models.CommandJob; import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; import com.azure.resourcemanager.machinelearning.models.Goal; @@ -19,6 +20,7 @@ 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.MLFlowAutologgerState; import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; import com.azure.resourcemanager.machinelearning.models.Mpi; @@ -39,7 +41,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/2022-12-01-preview/examples/Job/AutoMLJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate AutoML Job. @@ -107,7 +109,7 @@ public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelear } /* - * 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/2022-12-01-preview/examples/Job/SweepJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Sweep Job. @@ -172,7 +174,7 @@ public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearn } /* - * 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/2022-12-01-preview/examples/Job/PipelineJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Pipeline Job. @@ -217,7 +219,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/2022-12-01-preview/examples/Job/CommandJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Command Job. @@ -247,6 +249,8 @@ public static void createOrUpdateCommandJob( .withJobServiceType("string") .withPort(1) .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.ENABLED)) .withCodeId("fakeTokenPlaceholder") .withCommand("string") .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) 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 79d3eca1e629f..6aa10030419ca 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 @@ -9,7 +9,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/2022-12-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 e6168670bbdd4..51621eac2c783 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 @@ -9,7 +9,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/2022-12-01-preview/examples/Job/CommandJob/get.json */ /** * Sample code: Get Command Job. @@ -21,7 +21,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/2022-12-01-preview/examples/Job/AutoMLJob/get.json */ /** * Sample code: Get AutoML Job. @@ -33,7 +33,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/2022-12-01-preview/examples/Job/SweepJob/get.json */ /** * Sample code: Get Sweep Job. @@ -45,7 +45,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/2022-12-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 53cec01043128..91133f980f8ca 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 @@ -9,7 +9,7 @@ /** 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/2022-12-01-preview/examples/Job/CommandJob/list.json */ /** * Sample code: List Command Job. @@ -17,11 +17,11 @@ public final class JobsListSamples { * @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", null, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/PipelineJob/list.json */ /** * Sample code: List Pipeline Job. @@ -29,11 +29,11 @@ public static void listCommandJob(com.azure.resourcemanager.machinelearning.Mach * @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, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/SweepJob/list.json */ /** * Sample code: List Sweep Job. @@ -41,11 +41,11 @@ public static void listPipelineJob(com.azure.resourcemanager.machinelearning.Mac * @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", null, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, "string", "string", null, null, null, 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/2022-12-01-preview/examples/Job/AutoMLJob/list.json */ /** * Sample code: List AutoML Job. @@ -53,6 +53,6 @@ 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, Context.NONE); + manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, null, null, Context.NONE); } } 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..ca0f0b76f9005 --- /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/2022-12-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..80cea76fe78fa --- /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; + +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Delete. */ +public final class LabelingJobsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..2a862846468be --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsExportLabelsSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.util.Context; +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/2022-12-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(), 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..b290d96c9defe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Get. */ +public final class LabelingJobsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..66f369890b595 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LabelingJobs List. */ +public final class LabelingJobsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..01571610f3867 --- /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; + +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Pause. */ +public final class LabelingJobsPauseSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..b13b64fd7dfa0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for LabelingJobs Resume. */ +public final class LabelingJobsResumeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..c58f4f94af8b1 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +13,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/2022-12-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"))), + 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 adef04a7a70d0..7ba9f2bc49b97 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 @@ -9,14 +9,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/2022-12-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", 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 497709ceef458..50e594377f6cc 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 @@ -9,14 +9,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/2022-12-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", 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 d26830e926959..48cc9e562385f 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 @@ -9,14 +9,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/2022-12-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, 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..e41806bac0f3c 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,8 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.core.util.Context; +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 +14,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/2022-12-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")), + 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 9cfb11ae578e8..631d2694fb322 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 @@ -9,14 +9,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/2022-12-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", 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 126ed1ba1652f..2aa9799b4d8fb 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 @@ -9,14 +9,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/2022-12-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", 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 141889bab67c9..b630a41190b1a 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 @@ -9,14 +9,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/2022-12-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( 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..4ce28896deaa0 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/2022-12-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/2022-12-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 cce60c026597d..8e78d097a8fc1 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 @@ -9,14 +9,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/2022-12-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().delete("testrg123", "workspace123", "testEndpoint", "testDeployment", Context.NONE); } 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 9bfb98fba3cfc..309f524f596ec 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 @@ -11,7 +11,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/2022-12-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 97f17df8f8af6..f06e80dc654a1 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 @@ -9,7 +9,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/2022-12-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json */ /** * Sample code: Get Kubernetes Online Deployment. @@ -24,7 +24,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/2022-12-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 ad1711b9a2e14..2e57d4fcbe515 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 @@ -9,7 +9,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/2022-12-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 17324a04021e1..1f727df7861ed 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 @@ -9,7 +9,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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json */ /** * Sample code: List Managed Online Deployment Skus. @@ -24,7 +24,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/2022-12-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 e6f7f289fd83d..ea4348876a0da 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 @@ -14,7 +14,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/2022-12-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json */ /** * Sample code: Update Managed Online Deployment. @@ -42,7 +42,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/2022-12-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..97a5d7a0c8d66 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/2022-12-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 dbc32b0655817..069251f39a992 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 @@ -9,14 +9,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/2022-12-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", 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 bdd66e6d66e7b..9a223f3fa01dd 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 @@ -9,14 +9,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/2022-12-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", 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 ef525f6fb1a83..be03bfeb795c5 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 @@ -9,14 +9,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/2022-12-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().getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", Context.NONE); } 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 eff0fc782162a..b01e28972e298 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 @@ -9,14 +9,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/2022-12-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().listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", Context.NONE); } 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 371e79a23f6eb..a259024af67ef 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 @@ -11,14 +11,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/2022-12-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 5a63089dd662f..9b45f8f8a9a1a 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 @@ -11,14 +11,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/2022-12-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 a75ca9e362cdd..c88cf10e46a7d 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 @@ -17,15 +17,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/2022-12-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 535d30a182d25..73962c6ee284b 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 @@ -9,7 +9,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/2022-12-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..9bff326a4ed1a 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 @@ -10,7 +10,7 @@ /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json */ /** * Sample code: WorkspacePutPrivateEndpointConnection. 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 7aeb72c169ace..f4a5536ebddf4 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 @@ -9,7 +9,7 @@ /** 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/2022-12-01-preview/examples/PrivateEndpointConnection/delete.json */ /** * Sample code: WorkspaceDeletePrivateEndpointConnection. 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 a9877cd045052..8197aacdcd5b2 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 @@ -9,7 +9,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/2022-12-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 75de715db85bb..e805d69c415ce 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 @@ -9,7 +9,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/2022-12-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 4f3d9e2efcfc6..d9a6fdc3bc9e5 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 @@ -9,7 +9,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/2022-12-01-preview/examples/PrivateLinkResource/list.json */ /** * Sample code: WorkspaceListPrivateLinkResources. 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 03b27ce1c0075..df0639298ed85 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 @@ -9,7 +9,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/2022-12-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 81b0f4d92b969..7d13d69361db8 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 @@ -13,7 +13,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/2022-12-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..0d7118f511348 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.RegistryProperties; +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/2022-12-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") + .withProperties( + new RegistryProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountSku("string") + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountType("string") + .withAllowBlobPublicAccess(false))))))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.BASIC) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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") + .withProperties( + new RegistryProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "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")))))))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.BASIC) + .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; + } +} 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..e35994ab40f84 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..b43489cae4bec --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..7b9a4e2015140 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", null, 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..b53a4ae390dfe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-01-preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistries(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(null, Context.NONE); + } +} 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..811a972110b3e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.io.IOException; +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/2022-12-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) throws IOException { + Registry resource = + manager.registries().getByResourceGroupWithResponse("test-rg", "string", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new PartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withKind("string") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .apply(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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) throws IOException { + Registry resource = + manager.registries().getByResourceGroupWithResponse("test-rg", "string", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new PartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withKind("string") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .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..203999b75bea1 --- /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/2022-12-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..ad0e09520a4f2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers Delete. */ +public final class RegistryCodeContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..fbcddf2ed3eea --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers Get. */ +public final class RegistryCodeContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..774a6dad952ca --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeContainers List. */ +public final class RegistryCodeContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..6a66d0d49ff1c --- /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/2022-12-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..65bccc1ad20d6 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions Delete. */ +public final class RegistryCodeVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..940eb88461888 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions Get. */ +public final class RegistryCodeVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..377354c0dbdbb --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryCodeVersions List. */ +public final class RegistryCodeVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..7f01b898c4d74 --- /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/2022-12-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..39c0067a4f8f7 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers Delete. */ +public final class RegistryComponentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..ef62c9033c5da --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers Get. */ +public final class RegistryComponentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..b6d4e7181c09e --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryComponentContainers List. */ +public final class RegistryComponentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..83587ae7b53ea --- /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/2022-12-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..4f4c4443451ee --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryComponentVersions Delete. */ +public final class RegistryComponentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..bfb38fee969f2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.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.core.util.Context; + +/** Samples for RegistryComponentVersions Get. */ +public final class RegistryComponentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..1b7d3687fa228 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.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.core.util.Context; + +/** Samples for RegistryComponentVersions List. */ +public final class RegistryComponentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..9b47115dd196b --- /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/2022-12-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..fabc7f557f2a9 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentContainers Delete. */ +public final class RegistryEnvironmentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..ffa793bbfcb51 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.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.core.util.Context; + +/** Samples for RegistryEnvironmentContainers Get. */ +public final class RegistryEnvironmentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..b8343822d8e37 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentContainers List. */ +public final class RegistryEnvironmentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..4315cd0887b22 --- /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/2022-12-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..d9ac02271f571 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryEnvironmentVersions Delete. */ +public final class RegistryEnvironmentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..08537bc45cd31 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.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.core.util.Context; + +/** Samples for RegistryEnvironmentVersions Get. */ +public final class RegistryEnvironmentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..73ce2f8b8ecf5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.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.core.util.Context; + +/** Samples for RegistryEnvironmentVersions List. */ +public final class RegistryEnvironmentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..9a9bbc2e07e84 --- /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/2022-12-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..8ef7199927bb1 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers Delete. */ +public final class RegistryModelContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..6a1f852a775d1 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers Get. */ +public final class RegistryModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..388a8da7ef3db --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelContainers List. */ +public final class RegistryModelContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, 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..0b737f9fc8e00 --- /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/2022-12-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..3e7e1ab25f664 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions Delete. */ +public final class RegistryModelVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..a380de2427333 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions Get. */ +public final class RegistryModelVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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", 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..70e8a55f33b03 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for RegistryModelVersions List. */ +public final class RegistryModelVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2022-12-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, + Context.NONE); + } +} 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..517aa13e197f2 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/2022-12-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 851c5e1506a7a..e533a9b53889c 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 @@ -9,7 +9,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/2022-12-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 ba69d8c6712e6..b1d8e9b400a2b 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 @@ -9,7 +9,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/2022-12-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 cd2b6cab1a999..31955f616d585 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 @@ -9,7 +9,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/2022-12-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 7d5bc70488f01..f9ba3317f980c 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 @@ -9,7 +9,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/2022-12-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 3fdf1082b1f92..6b3b104feca4c 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 @@ -9,7 +9,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/2022-12-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..7c4b6e08b19d8 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 @@ -4,13 +4,12 @@ package com.azure.resourcemanager.machinelearning.generated; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; /** 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/2022-12-01-preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. @@ -25,7 +24,7 @@ public static void createWorkspaceConnection( .withExistingWorkspace("resourceGroup-1", "workspace-1") .withProperties( new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withCategory("ContainerRegistry") .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 f4ece10545351..1ec8138971ff1 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 @@ -9,7 +9,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/2022-12-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 05a98fd2126f0..50aaddef1d8b0 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 @@ -9,7 +9,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/2022-12-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 c1f5ead731710..60a028f1523b7 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 @@ -9,7 +9,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/2022-12-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/WorkspaceFeaturesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java index 2a2058ff590cc..930b417c2b129 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 @@ -9,7 +9,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/2022-12-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..defdda47da91d 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 @@ -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/2022-12-01-preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. 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 565c455c37ec3..e7090613f665a 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 @@ -9,7 +9,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/2022-12-01-preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. 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 f36873cb567ff..4ba1aa4fa01d3 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 @@ -13,7 +13,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/2022-12-01-preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. 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 87df8c3529f39..4f7234ff568cf 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 @@ -9,7 +9,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/2022-12-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 fd7e81ba97f15..c6bbc43eee44f 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 @@ -9,7 +9,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/2022-12-01-preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. 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 b534058016846..749dcd3ec2a4b 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 @@ -9,7 +9,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/2022-12-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 a1fef26165067..a9670b0bfe707 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 @@ -9,7 +9,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/2022-12-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 35c08b1e4b644..9a78de4440981 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 @@ -9,7 +9,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/2022-12-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 bfa2c44af7253..92a47dd6ba643 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 @@ -9,7 +9,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/2022-12-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 38cd347226bfe..7fb342c9fd7c0 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 @@ -9,7 +9,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/2022-12-01-preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. 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 979019e45cf22..62a97d659a228 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 @@ -9,7 +9,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/2022-12-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 dbf845abf21ad..508780662c305 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 @@ -9,7 +9,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/2022-12-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 0d20122240253..d897cd60bbd50 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 @@ -9,7 +9,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/2022-12-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 b8ff6b0d78241..9fa508ca9e973 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 @@ -11,7 +11,7 @@ /** 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/2022-12-01-preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. 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 d305c14919b47..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.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.AksNetworkingConfiguration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AksNetworkingConfigurationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 9ed077e4d905a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.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.AmlComputeNodeInformation; -import org.junit.jupiter.api.Test; - -public final class AmlComputeNodeInformationTests { - @Test - public void testDeserialize() { - AmlComputeNodeInformation model = - BinaryData - .fromString( - "{\"nodeId\":\"hsmtxpsiebtfhvp\",\"privateIpAddress\":\"apskrdqm\",\"publicIpAddress\":\"jdhtldwkyzxu\",\"port\":379697539,\"nodeState\":\"unusable\",\"runId\":\"scwsv\"}") - .toObject(AmlComputeNodeInformation.class); - } - - @Test - public void testSerialize() { - 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 12a26adfa2db1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.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.AmlComputeNodesInformation; -import org.junit.jupiter.api.Test; - -public final class AmlComputeNodesInformationTests { - @Test - public void testDeserialize() { - 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); - } - - @Test - public void testSerialize() { - 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 ce3a4986ea774..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.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.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AmlOperationDisplayTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 751eb63504921..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.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.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AmlOperationInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 29a9974f8b09b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class AmlOperationListResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 048e9e95b9d13..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.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.AmlToken; -import org.junit.jupiter.api.Test; - -public final class AmlTokenTests { - @Test - public void testDeserialize() { - AmlToken model = BinaryData.fromString("{\"identityType\":\"AMLToken\"}").toObject(AmlToken.class); - } - - @Test - public void testSerialize() { - 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 9bc55ec196b6c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.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.fluent.models.AmlUserFeatureInner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AmlUserFeatureInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a045d82653bfb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.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.AssetBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssetBaseTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 08dc5c8a11b40..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.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.AssetContainer; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssetContainerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 6cbb4a61d527b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.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.AssetJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssetJobInputTests { - @Test - public void testDeserialize() { - AssetJobInput model = - BinaryData.fromString("{\"mode\":\"ReadOnlyMount\",\"uri\":\"fgbrtt\"}").toObject(AssetJobInput.class); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("fgbrtt", model.uri()); - } - - @Test - public void testSerialize() { - 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 8d6b5001bf622..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.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.AssetJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssetJobOutputTests { - @Test - public void testDeserialize() { - AssetJobOutput model = - BinaryData.fromString("{\"mode\":\"Upload\",\"uri\":\"lkiexhajlfnthiq\"}").toObject(AssetJobOutput.class); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("lkiexhajlfnthiq", model.uri()); - } - - @Test - public void testSerialize() { - 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 40ea4f96c7792..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.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.AssetReferenceBase; -import org.junit.jupiter.api.Test; - -public final class AssetReferenceBaseTests { - @Test - public void testDeserialize() { - AssetReferenceBase model = - BinaryData.fromString("{\"referenceType\":\"AssetReferenceBase\"}").toObject(AssetReferenceBase.class); - } - - @Test - public void testSerialize() { - 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 0ecefccaebf3e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.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.AssignedUser; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AssignedUserTests { - @Test - public void testDeserialize() { - AssignedUser model = - BinaryData - .fromString("{\"objectId\":\"mykyujxsglhs\",\"tenantId\":\"rryejylmbkzudnig\"}") - .toObject(AssignedUser.class); - Assertions.assertEquals("mykyujxsglhs", model.objectId()); - Assertions.assertEquals("rryejylmbkzudnig", model.tenantId()); - } - - @Test - public void testSerialize() { - 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 222528413f874..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.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.AutoForecastHorizon; -import org.junit.jupiter.api.Test; - -public final class AutoForecastHorizonTests { - @Test - public void testDeserialize() { - AutoForecastHorizon model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoForecastHorizon.class); - } - - @Test - public void testSerialize() { - 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 f6e78d91d2b68..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class AutoMLJobTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 256b3f5625c3d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.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.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; -import org.junit.jupiter.api.Test; - -public final class AutoMLVerticalTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 fb0bc876a8edc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.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.AutoNCrossValidations; -import org.junit.jupiter.api.Test; - -public final class AutoNCrossValidationsTests { - @Test - public void testDeserialize() { - AutoNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoNCrossValidations.class); - } - - @Test - public void testSerialize() { - 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 f942de9e3ec7e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.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.AutoPauseProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AutoPausePropertiesTests { - @Test - public void testDeserialize() { - AutoPauseProperties model = - BinaryData - .fromString("{\"delayInMinutes\":1505052289,\"enabled\":true}") - .toObject(AutoPauseProperties.class); - Assertions.assertEquals(1505052289, model.delayInMinutes()); - Assertions.assertEquals(true, model.enabled()); - } - - @Test - public void testSerialize() { - 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 df4ab527734ad..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.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.AutoScaleProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AutoScalePropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 b79e8630b41ed..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.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.AutoSeasonality; -import org.junit.jupiter.api.Test; - -public final class AutoSeasonalityTests { - @Test - public void testDeserialize() { - AutoSeasonality model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoSeasonality.class); - } - - @Test - public void testSerialize() { - 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 0476836f1bdb9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.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.AutoTargetLags; -import org.junit.jupiter.api.Test; - -public final class AutoTargetLagsTests { - @Test - public void testDeserialize() { - AutoTargetLags model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetLags.class); - } - - @Test - public void testSerialize() { - 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 8e243be0b7311..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.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.AutoTargetRollingWindowSize; -import org.junit.jupiter.api.Test; - -public final class AutoTargetRollingWindowSizeTests { - @Test - public void testDeserialize() { - AutoTargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetRollingWindowSize.class); - } - - @Test - public void testSerialize() { - 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 2a8d5d18d29bd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.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.BanditPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BanditPolicyTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e13374183b885..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class BatchDeploymentTrackedResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - BatchDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"byuqerpqlp\",\"value\":[{\"identity\":{\"principalId\":\"c9a6d637-0074-42d0-ac95-22e4866ed7f2\",\"tenantId\":\"bde40d98-edf9-4257-81c1-ff2eb1eaa331\",\"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\":\"d2980a2a-72b7-4299-b23e-11e1bbaad762\",\"tenantId\":\"82d6a0fa-ffa4-4c24-a2ce-74aae4ae64ab\",\"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\":\"a6b9562c-5d15-4042-ac41-45c8b64d10c5\",\"tenantId\":\"f8adbbb1-f380-4a2a-ba40-1703488e9225\",\"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\":\"8407fdfc-3489-43a0-aab0-268a28d71da1\",\"tenantId\":\"ce2591e0-770a-41dc-a1bb-6125b7a58935\",\"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()); - } - - @Test - public void testSerialize() { - 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 a231489aff5aa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.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.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.core.util.Context; -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", 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 9b23acaf6f751..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.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.BatchEndpointDefaults; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BatchEndpointDefaultsTests { - @Test - public void testDeserialize() { - BatchEndpointDefaults model = - BinaryData.fromString("{\"deploymentName\":\"wsbpfvm\"}").toObject(BatchEndpointDefaults.class); - Assertions.assertEquals("wsbpfvm", model.deploymentName()); - } - - @Test - public void testSerialize() { - 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 d26cdbdb749ab..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class BatchEndpointTrackedResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - BatchEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"gcj\",\"value\":[{\"identity\":{\"principalId\":\"aa9c3689-b36d-4d26-ab58-0d46868c779e\",\"tenantId\":\"44db6d48-a9b2-4023-ad6e-aac68d7b8948\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"ttdumorppxebmnzb\",\"properties\":{\"provisioningState\":\"Canceled\",\"authMode\":\"Key\",\"description\":\"lkfg\",\"properties\":{},\"scoringUri\":\"http://example.org/euel\",\"swaggerUri\":\"http://example.org/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()); - } - - @Test - public void testSerialize() { - 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 a78eaf82e91ea..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.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.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.core.util.Context; -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", 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 a2bc23cc30995..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.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.BatchRetrySettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BatchRetrySettingsTests { - @Test - public void testDeserialize() { - BatchRetrySettings model = - BinaryData - .fromString("{\"maxRetries\":80770684,\"timeout\":\"PT155H21M58S\"}") - .toObject(BatchRetrySettings.class); - Assertions.assertEquals(80770684, model.maxRetries()); - Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout()); - } - - @Test - public void testSerialize() { - 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 f93503bd7ea16..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.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.BayesianSamplingAlgorithm; -import org.junit.jupiter.api.Test; - -public final class BayesianSamplingAlgorithmTests { - @Test - public void testDeserialize() { - BayesianSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Bayesian\"}").toObject(BayesianSamplingAlgorithm.class); - } - - @Test - public void testSerialize() { - 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 51c224a9a4d90..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.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.BuildContext; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BuildContextTests { - @Test - public void testDeserialize() { - BuildContext model = - BinaryData - .fromString("{\"contextUri\":\"mfpjbabw\",\"dockerfilePath\":\"fcxsspuunnoxy\"}") - .toObject(BuildContext.class); - Assertions.assertEquals("mfpjbabw", model.contextUri()); - Assertions.assertEquals("fcxsspuunnoxy", model.dockerfilePath()); - } - - @Test - public void testSerialize() { - 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 65f79e53834d6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ClassificationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 005e6f747a826..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ClassificationTrainingSettingsTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 194f75dfb57bc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.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.ClusterUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import org.junit.jupiter.api.Test; - -public final class ClusterUpdateParametersTests { - @Test - public void testDeserialize() { - ClusterUpdateParameters model = - BinaryData.fromString("{\"properties\":{\"properties\":{}}}").toObject(ClusterUpdateParameters.class); - } - - @Test - public void testSerialize() { - 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 cfd2686bd300f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ClusterUpdatePropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8b6fb0aa3c605..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class CodeContainerInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 fe7552edbbff6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.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.CodeContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CodeContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 2cac2ea497027..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class CodeContainerResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8ff9ad97e0104..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 56e2cdadcbaf7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.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.core.util.Context; -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", 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 35dc59b9b0489..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.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.core.util.Context; -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", 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 e9add8af4f128..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 e31d7424ce48e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.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.ColumnTransformer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ColumnTransformerTests { - @Test - public void testDeserialize() { - ColumnTransformer model = - BinaryData - .fromString("{\"fields\":[\"dsmjtgr\",\"gdgkki\"],\"parameters\":\"dataplkcsm\"}") - .toObject(ColumnTransformer.class); - Assertions.assertEquals("dsmjtgr", model.fields().get(0)); - } - - @Test - public void testSerialize() { - 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 eea4295847de2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.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.CommandJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommandJobLimitsTests { - @Test - public void testDeserialize() { - CommandJobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"Command\",\"timeout\":\"PT130H21M4S\"}") - .toObject(CommandJobLimits.class); - Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout()); - } - - @Test - public void testSerialize() { - 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 eda467c08070a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.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.ComponentContainerInner; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComponentContainerInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 eaae547d00e1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.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.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComponentContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 cad23b4dd93dd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ComponentContainerResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 484a93ab19e9a..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.core.util.Context; -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", 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 1c8d46bba036f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.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.core.util.Context; -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", 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 c2b7fdf0e9a2d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.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.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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, 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 bdc4c35e87c10..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.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.ComponentVersionInner; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComponentVersionInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 91e58ca70561b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.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.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComponentVersionPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 c1fd023297578..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ComponentVersionResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 1e61f135844eb..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.core.util.Context; -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", 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 ba066030f17a0..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.core.util.Context; -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", 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 90b9c766e9e45..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.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.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.core.util.Context; -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, - 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 c659918c6ad5d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.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.ComputeInstanceApplication; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceApplicationTests { - @Test - public void testDeserialize() { - ComputeInstanceApplication model = - BinaryData - .fromString("{\"displayName\":\"cyychunsjlp\",\"endpointUri\":\"twszhvvuic\"}") - .toObject(ComputeInstanceApplication.class); - Assertions.assertEquals("cyychunsjlp", model.displayName()); - Assertions.assertEquals("twszhvvuic", model.endpointUri()); - } - - @Test - public void testSerialize() { - 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 885ebee2748ad..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.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.ComputeInstanceConnectivityEndpoints; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceConnectivityEndpointsTests { - @Test - public void testDeserialize() { - ComputeInstanceConnectivityEndpoints model = - BinaryData - .fromString("{\"publicIpAddress\":\"vbrdfjmzsyzfho\",\"privateIpAddress\":\"h\"}") - .toObject(ComputeInstanceConnectivityEndpoints.class); - } - - @Test - public void testSerialize() { - 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 053eabad65836..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceContainerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e29e26604805c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.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.ComputeInstanceCreatedBy; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceCreatedByTests { - @Test - public void testDeserialize() { - ComputeInstanceCreatedBy model = - BinaryData - .fromString( - "{\"userName\":\"vtrrmhwrbfdpyflu\",\"userOrgId\":\"vjglrocuyzlwhhme\",\"userId\":\"ooclutnp\"}") - .toObject(ComputeInstanceCreatedBy.class); - } - - @Test - public void testSerialize() { - 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 bcdd7ff1b9e5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.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.Caching; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataDisk; -import com.azure.resourcemanager.machinelearning.models.StorageAccountType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceDataDiskTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8a4fe58487371..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceDataMountTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 32c23718ec3da..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.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.ComputeInstanceEnvironmentInfo; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceEnvironmentInfoTests { - @Test - public void testDeserialize() { - ComputeInstanceEnvironmentInfo model = - BinaryData - .fromString("{\"name\":\"incqlhriswsl\",\"version\":\"iiovgqcgxu\"}") - .toObject(ComputeInstanceEnvironmentInfo.class); - Assertions.assertEquals("incqlhriswsl", model.name()); - Assertions.assertEquals("iiovgqcgxu", model.version()); - } - - @Test - public void testSerialize() { - 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 bc3865f2378b5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceLastOperationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5982f6ced4fa4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.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.ComputeInstanceVersion; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeInstanceVersionTests { - @Test - public void testDeserialize() { - ComputeInstanceVersion model = - BinaryData.fromString("{\"runtime\":\"z\"}").toObject(ComputeInstanceVersion.class); - Assertions.assertEquals("z", model.runtime()); - } - - @Test - public void testSerialize() { - 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 2270178c40ef5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ComputeResourceInnerTests { - @Test - public void testDeserialize() { - ComputeResourceInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"a3042893-f595-483d-8d13-b8f8fa8569c6\",\"tenantId\":\"5f2bfd89-eabb-4504-9884-a468d0ad70e9\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"idokgjlj\":{\"principalId\":\"abdcd1f6-cbab-49a8-9041-0db070881b3b\",\"clientId\":\"d91f8efc-2334-4d63-98ed-897009bf02d2\"}}},\"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()); - } - - @Test - public void testSerialize() { - 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 a92011af5291e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.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.Compute; -import com.azure.resourcemanager.machinelearning.models.ComputeResourceSchema; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeResourceSchemaTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 06137607f8ea7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ComputeSchedulesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 755f2fd5b30df..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.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.fluent.models.ComputeSecretsInner; -import org.junit.jupiter.api.Test; - -public final class ComputeSecretsInnerTests { - @Test - public void testDeserialize() { - ComputeSecretsInner model = - BinaryData.fromString("{\"computeType\":\"ComputeSecrets\"}").toObject(ComputeSecretsInner.class); - } - - @Test - public void testSerialize() { - 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 ee0a458cea312..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ComputeStartStopScheduleTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5974ac8b299fb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.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.Compute; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ComputeTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5c97e086982f0..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\":\"c6744fb0-8cc2-40b4-bb89-86b4b9d4cd0a\",\"tenantId\":\"778e36b9-e91a-44e6-aafe-dd8fd9a73872\",\"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 94aec7faa853a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.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.core.util.Context; -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, 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 c0620aa495273..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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\":\"e8b0fab5-16a4-4238-a26b-e5ee12265622\",\"tenantId\":\"3c0008f9-6b99-4e44-992d-ef80a623d40c\",\"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", 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 83357a025cfa7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.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.core.util.Context; -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", 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 73d92c9db5e62..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.core.util.Context; -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\":\"8c8e795b-1689-46c2-a93d-fcfad53cca19\",\"tenantId\":\"4955bab5-97e8-4fc6-8047-f6728782f624\",\"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", 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 78bdd26e0abf5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.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.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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", 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 ff1d9b975e364..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.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.models.ContainerResourceRequirements; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerResourceRequirementsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 387cfc7e9ec4f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.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.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerResourceSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e66b1f9d92cc0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.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.CosmosDbSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CosmosDbSettingsTests { - @Test - public void testDeserialize() { - CosmosDbSettings model = - BinaryData.fromString("{\"collectionsThroughput\":1098993569}").toObject(CosmosDbSettings.class); - Assertions.assertEquals(1098993569, model.collectionsThroughput()); - } - - @Test - public void testSerialize() { - 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 bd7e7306e0a47..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.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.CronTrigger; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CronTriggerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e6ea1cc42130a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.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.CustomForecastHorizon; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomForecastHorizonTests { - @Test - public void testDeserialize() { - CustomForecastHorizon model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":632851650}").toObject(CustomForecastHorizon.class); - Assertions.assertEquals(632851650, model.value()); - } - - @Test - public void testSerialize() { - 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 87effc4fd9212..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.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.CustomModelJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomModelJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8ad94dc60b77c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.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.CustomModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomModelJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 35b041e9bbf26..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.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.CustomNCrossValidations; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomNCrossValidationsTests { - @Test - public void testDeserialize() { - CustomNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":691698964}").toObject(CustomNCrossValidations.class); - Assertions.assertEquals(691698964, model.value()); - } - - @Test - public void testSerialize() { - 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 2981df9ec5fa8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.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.CustomSeasonality; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomSeasonalityTests { - @Test - public void testDeserialize() { - CustomSeasonality model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":1578351643}").toObject(CustomSeasonality.class); - Assertions.assertEquals(1578351643, model.value()); - } - - @Test - public void testSerialize() { - 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 69c88dbf6ee12..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.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.CustomTargetLags; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomTargetLagsTests { - @Test - public void testDeserialize() { - CustomTargetLags model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"values\":[915823701,1407190218,425904374]}") - .toObject(CustomTargetLags.class); - Assertions.assertEquals(915823701, model.values().get(0)); - } - - @Test - public void testSerialize() { - 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 1f0111319fab8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.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.CustomTargetRollingWindowSize; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomTargetRollingWindowSizeTests { - @Test - public void testDeserialize() { - CustomTargetRollingWindowSize model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"value\":482115950}") - .toObject(CustomTargetRollingWindowSize.class); - Assertions.assertEquals(482115950, model.value()); - } - - @Test - public void testSerialize() { - 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 2d884722f8f9e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class DataContainerInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 fdd8580d629ee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.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.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5c0175c79c7e7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class DataContainerResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e38f0ad0ca260..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 d3769a5fe8af3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.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.core.util.Context; -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", 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 92f120cee5d4e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.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.core.util.Context; -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, 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 0a4d2040ebdb5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.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.DataFactory; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataFactoryTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 c432b8c16611d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.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.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataLakeAnalyticsSchemaPropertiesTests { - @Test - public void testDeserialize() { - DataLakeAnalyticsSchemaProperties model = - BinaryData - .fromString("{\"dataLakeStoreAccountName\":\"b\"}") - .toObject(DataLakeAnalyticsSchemaProperties.class); - Assertions.assertEquals("b", model.dataLakeStoreAccountName()); - } - - @Test - public void testSerialize() { - 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 95edb2eabd0b7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.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.DataLakeAnalyticsSchema; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataLakeAnalyticsSchemaTests { - @Test - public void testDeserialize() { - DataLakeAnalyticsSchema model = - BinaryData - .fromString("{\"properties\":{\"dataLakeStoreAccountName\":\"mg\"}}") - .toObject(DataLakeAnalyticsSchema.class); - Assertions.assertEquals("mg", model.properties().dataLakeStoreAccountName()); - } - - @Test - public void testSerialize() { - 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 db616096ebe91..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.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.DataLakeAnalytics; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataLakeAnalyticsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 37b1b1cc294fb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.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.DataPathAssetReference; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataPathAssetReferenceTests { - @Test - public void testDeserialize() { - DataPathAssetReference model = - BinaryData - .fromString( - "{\"referenceType\":\"DataPath\",\"datastoreId\":\"uwxeoiojfizf\",\"path\":\"kjzwfbcyayk\"}") - .toObject(DataPathAssetReference.class); - Assertions.assertEquals("uwxeoiojfizf", model.datastoreId()); - Assertions.assertEquals("kjzwfbcyayk", model.path()); - } - - @Test - public void testSerialize() { - 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 51f7d7a35dcd5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.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.DataVersionBaseInner; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataVersionBaseInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a6b1740aebb89..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.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.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataVersionBasePropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5c143be031425..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class DataVersionBaseResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 b2f8b0fbfd3e1..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.core.util.Context; -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", 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 a3755bd1c0577..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.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.core.util.Context; -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", 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 c557e0e8199f2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.core.util.Context; -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, - 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 d06e94b71f9d6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class DatastoreResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 209256391c24f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 613b4e5c5bdb9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.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.DefaultScaleSettings; -import org.junit.jupiter.api.Test; - -public final class DefaultScaleSettingsTests { - @Test - public void testDeserialize() { - DefaultScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"Default\"}").toObject(DefaultScaleSettings.class); - } - - @Test - public void testSerialize() { - 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 7dcc0a492a5be..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.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.fluent.models.DeploymentLogsInner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeploymentLogsInnerTests { - @Test - public void testDeserialize() { - DeploymentLogsInner model = - BinaryData.fromString("{\"content\":\"jcxcjxgrytfmpcyc\"}").toObject(DeploymentLogsInner.class); - Assertions.assertEquals("jcxcjxgrytfmpcyc", model.content()); - } - - @Test - public void testSerialize() { - 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 1f36ec8d6aa5f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.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.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeploymentLogsRequestTests { - @Test - public void testDeserialize() { - DeploymentLogsRequest model = - BinaryData - .fromString("{\"containerType\":\"StorageInitializer\",\"tail\":304740778}") - .toObject(DeploymentLogsRequest.class); - Assertions.assertEquals(ContainerType.STORAGE_INITIALIZER, model.containerType()); - Assertions.assertEquals(304740778, model.tail()); - } - - @Test - public void testSerialize() { - 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 5f68d451cd943..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.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.DeploymentResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeploymentResourceConfigurationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 915f849a10882..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.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.DistributionConfiguration; -import org.junit.jupiter.api.Test; - -public final class DistributionConfigurationTests { - @Test - public void testDeserialize() { - DistributionConfiguration model = - BinaryData - .fromString("{\"distributionType\":\"DistributionConfiguration\"}") - .toObject(DistributionConfiguration.class); - } - - @Test - public void testSerialize() { - 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 e502d4775af4f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.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.EarlyTerminationPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EarlyTerminationPolicyTests { - @Test - public void testDeserialize() { - EarlyTerminationPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1491450827,\"evaluationInterval\":935954000}") - .toObject(EarlyTerminationPolicy.class); - Assertions.assertEquals(1491450827, model.delayEvaluation()); - Assertions.assertEquals(935954000, model.evaluationInterval()); - } - - @Test - public void testSerialize() { - 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 7d5feeacf40ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.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.EndpointScheduleAction; -import org.junit.jupiter.api.Test; - -public final class EndpointScheduleActionTests { - @Test - public void testDeserialize() { - EndpointScheduleAction model = - BinaryData - .fromString("{\"actionType\":\"InvokeBatchEndpoint\",\"endpointInvocationDefinition\":\"datamfzsbf\"}") - .toObject(EndpointScheduleAction.class); - } - - @Test - public void testSerialize() { - 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 8c94d783355b1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.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.EnvironmentContainerInner; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EnvironmentContainerInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 be191aa077509..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.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.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EnvironmentContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 dfdcf12ad142c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class EnvironmentContainerResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 733475a4c7e5f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 5abd60f61c0b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.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.core.util.Context; -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", 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 fe075691584ca..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.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.core.util.Context; -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, 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 84293c571ad61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class EnvironmentVersionInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 1adc46cbb56fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class EnvironmentVersionPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e5ab2f5ab7162..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class EnvironmentVersionResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 86b46dccabaff..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 0157ccf934d8a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.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.core.util.Context; -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", 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 1f84921341685..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.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.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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, - 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 617efcd2d7b5e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.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.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EstimatedVMPriceTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 00d6040806302..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class EstimatedVMPricesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 85a5d6e131c90..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ExternalFqdnResponseInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 d0fb22d754d6c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.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.FeaturizationSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FeaturizationSettingsTests { - @Test - public void testDeserialize() { - FeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"hwtbbaedorvvm\"}").toObject(FeaturizationSettings.class); - Assertions.assertEquals("hwtbbaedorvvm", model.datasetLanguage()); - } - - @Test - public void testSerialize() { - 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 bc3fa767fd7f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.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.FlavorData; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FlavorDataTests { - @Test - public void testDeserialize() { - FlavorData model = - BinaryData - .fromString( - "{\"data\":{\"sdbccxjmonfdgnwn\":\"bdkelvidizo\",\"keifzzhmkdasv\":\"ypuuwwltvuqjctze\",\"cu\":\"lyhb\"}}") - .toObject(FlavorData.class); - Assertions.assertEquals("bdkelvidizo", model.data().get("sdbccxjmonfdgnwn")); - } - - @Test - public void testSerialize() { - 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 f2a5d48d7819f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.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.ForecastHorizon; -import org.junit.jupiter.api.Test; - -public final class ForecastHorizonTests { - @Test - public void testDeserialize() { - ForecastHorizon model = BinaryData.fromString("{\"mode\":\"ForecastHorizon\"}").toObject(ForecastHorizon.class); - } - - @Test - public void testSerialize() { - 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 67140c5b2345f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ForecastingSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 6fae13c025371..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ForecastingTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a41b9c597bdd9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ForecastingTrainingSettingsTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 401ca76c36299..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.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.FqdnEndpointDetail; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FqdnEndpointDetailTests { - @Test - public void testDeserialize() { - FqdnEndpointDetail model = BinaryData.fromString("{\"port\":1808760283}").toObject(FqdnEndpointDetail.class); - Assertions.assertEquals(1808760283, model.port()); - } - - @Test - public void testSerialize() { - 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 049f2f3e8fff1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.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.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FqdnEndpointTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 64826a88a4b8b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.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.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FqdnEndpointsPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 d498d0ea5073f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class FqdnEndpointsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 552ddb38e76df..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.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.GridSamplingAlgorithm; -import org.junit.jupiter.api.Test; - -public final class GridSamplingAlgorithmTests { - @Test - public void testDeserialize() { - GridSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Grid\"}").toObject(GridSamplingAlgorithm.class); - } - - @Test - public void testSerialize() { - 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 c5d1063387a38..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.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.IdAssetReference; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IdAssetReferenceTests { - @Test - public void testDeserialize() { - IdAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"Id\",\"assetId\":\"itpkpztrgdg\"}") - .toObject(IdAssetReference.class); - Assertions.assertEquals("itpkpztrgdg", model.assetId()); - } - - @Test - public void testSerialize() { - 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 c392c97acec1d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.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.IdentityConfiguration; -import org.junit.jupiter.api.Test; - -public final class IdentityConfigurationTests { - @Test - public void testDeserialize() { - IdentityConfiguration model = - BinaryData.fromString("{\"identityType\":\"IdentityConfiguration\"}").toObject(IdentityConfiguration.class); - } - - @Test - public void testSerialize() { - 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 61a96450001db..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.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.IdentityForCmk; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IdentityForCmkTests { - @Test - public void testDeserialize() { - IdentityForCmk model = - BinaryData.fromString("{\"userAssignedIdentity\":\"hanufhfcbjysagi\"}").toObject(IdentityForCmk.class); - Assertions.assertEquals("hanufhfcbjysagi", model.userAssignedIdentity()); - } - - @Test - public void testSerialize() { - 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 f7fbb46328075..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageClassificationBaseTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 7381271ac6ebe..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageClassificationMultilabelTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 6f5c95b803fc6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageClassificationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 35e6fbcad2319..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageInstanceSegmentationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 cf26d74cd26f9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.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.ImageLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ImageLimitSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 b1fe7fa2519ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelDistributionSettingsClassificationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 6122c9a3af2fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelDistributionSettingsObjectDetectionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 f1640db50a742..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelDistributionSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5216fa964685c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelSettingsClassificationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 b9691325993c9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelSettingsObjectDetectionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 18d0261f1d91d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageModelSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 565481a331914..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageObjectDetectionBaseTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e5a493304635b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class ImageObjectDetectionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 f0f759a957eba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.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.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ImageSweepSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 f1a0158bef404..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ImageVerticalTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 cd6c3c5412416..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.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.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.Route; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class InferenceContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 318c16ba5ad08..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.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.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class InstanceTypeSchemaResourcesTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 b4c6773d743ad..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.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.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class InstanceTypeSchemaTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 1f1537cca323a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class JobBaseInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 cfdfd0129f94b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class JobBasePropertiesTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 d4c2bd6b3d442..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class JobBaseResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 85d7f9e451a02..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.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.JobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JobInputTests { - @Test - public void testDeserialize() { - JobInput model = - BinaryData.fromString("{\"jobInputType\":\"JobInput\",\"description\":\"pjby\"}").toObject(JobInput.class); - Assertions.assertEquals("pjby", model.description()); - } - - @Test - public void testSerialize() { - 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 6ded0b880571f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.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.JobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JobLimitsTests { - @Test - public void testDeserialize() { - JobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"JobLimits\",\"timeout\":\"PT90H18M40S\"}") - .toObject(JobLimits.class); - Assertions.assertEquals(Duration.parse("PT90H18M40S"), model.timeout()); - } - - @Test - public void testSerialize() { - 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 c5e51d22cc4a6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.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.JobOutput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JobOutputTests { - @Test - public void testDeserialize() { - JobOutput model = - BinaryData - .fromString("{\"jobOutputType\":\"JobOutput\",\"description\":\"qmbzmq\"}") - .toObject(JobOutput.class); - Assertions.assertEquals("qmbzmq", model.description()); - } - - @Test - public void testSerialize() { - 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 aa8700e5c6dcc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.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.JobResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JobResourceConfigurationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 cd3016c53b5fc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.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.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; -import org.junit.jupiter.api.Test; - -public final class JobScheduleActionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e1bb19268e3d7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.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.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JobServiceTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 f8862fa8396f5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.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.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.core.util.Context; -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", 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 e56027977b763..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.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.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.core.util.Context; -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", 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 fa2561492a867..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.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.core.util.Context; -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", 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 3eb40eb35afb8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.core.util.Context; -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, - 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 8b400e3faee78..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class KubernetesPropertiesTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 8dff1b27ef669..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.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.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; -import org.junit.jupiter.api.Test; - -public final class KubernetesSchemaTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8f1e716d15509..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class KubernetesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 bb754902a27ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.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.ListAmlUserFeatureResult; -import org.junit.jupiter.api.Test; - -public final class ListAmlUserFeatureResultTests { - @Test - public void testDeserialize() { - ListAmlUserFeatureResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"cvclxynpdk\",\"displayName\":\"fabuiyjibu\",\"description\":\"hdugneiknpg\"},{\"id\":\"gjiuqhibto\",\"displayName\":\"pqwjedm\",\"description\":\"r\"}],\"nextLink\":\"g\"}") - .toObject(ListAmlUserFeatureResult.class); - } - - @Test - public void testSerialize() { - 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 3ed32d322ba2e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.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.ListUsagesResult; -import org.junit.jupiter.api.Test; - -public final class ListUsagesResultTests { - @Test - public void testDeserialize() { - 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); - } - - @Test - public void testSerialize() { - 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 5cb0bfe599e05..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.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.ListWorkspaceQuotas; -import org.junit.jupiter.api.Test; - -public final class ListWorkspaceQuotasTests { - @Test - public void testDeserialize() { - 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); - } - - @Test - public void testSerialize() { - 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 2fa3c589c580b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.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.LiteralJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LiteralJobInputTests { - @Test - public void testDeserialize() { - LiteralJobInput model = - BinaryData - .fromString("{\"jobInputType\":\"literal\",\"value\":\"mabeddqilwgdf\",\"description\":\"qfp\"}") - .toObject(LiteralJobInput.class); - Assertions.assertEquals("qfp", model.description()); - Assertions.assertEquals("mabeddqilwgdf", model.value()); - } - - @Test - public void testSerialize() { - 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 404305bfad8bc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.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.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MLFlowModelJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4f97aaff2d67e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.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.MLFlowModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MLFlowModelJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 f9fb88dfb6da3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.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.MLTableData; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MLTableDataTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 dc2b34bce9496..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.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.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MLTableJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 1099ee274c4fd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.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.MLTableJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MLTableJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 bf72393c720b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.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.ManagedIdentity; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedIdentityTests { - @Test - public void testDeserialize() { - ManagedIdentity model = - BinaryData - .fromString( - "{\"identityType\":\"Managed\",\"clientId\":\"dd0f49f5-db24-4169-b9f5-53147da3f246\",\"objectId\":\"07bfb568-5b32-45ee-82a2-ea5e6a4be770\",\"resourceId\":\"clg\"}") - .toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("dd0f49f5-db24-4169-b9f5-53147da3f246"), model.clientId()); - Assertions.assertEquals(UUID.fromString("07bfb568-5b32-45ee-82a2-ea5e6a4be770"), model.objectId()); - Assertions.assertEquals("clg", model.resourceId()); - } - - @Test - public void testSerialize() { - ManagedIdentity model = - new ManagedIdentity() - .withClientId(UUID.fromString("dd0f49f5-db24-4169-b9f5-53147da3f246")) - .withObjectId(UUID.fromString("07bfb568-5b32-45ee-82a2-ea5e6a4be770")) - .withResourceId("clg"); - model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("dd0f49f5-db24-4169-b9f5-53147da3f246"), model.clientId()); - Assertions.assertEquals(UUID.fromString("07bfb568-5b32-45ee-82a2-ea5e6a4be770"), 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 5ab247614187c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ManagedServiceIdentityTests { - @Test - public void testDeserialize() { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"c4eb4cc9-ffab-4e74-bdcd-49c343934c1a\",\"tenantId\":\"b48270f6-8e36-4c82-97fa-9614d652b2d6\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ginuvamih\":{\"principalId\":\"24383e8f-af05-48aa-b84d-2ad708f1e821\",\"clientId\":\"113029e5-648a-4f0a-8a46-61292e27d2ba\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @Test - public void testSerialize() { - 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 59bcdc3d5cb16..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.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.MedianStoppingPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MedianStoppingPolicyTests { - @Test - public void testDeserialize() { - MedianStoppingPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"MedianStopping\",\"delayEvaluation\":2026820948,\"evaluationInterval\":660103653}") - .toObject(MedianStoppingPolicy.class); - Assertions.assertEquals(2026820948, model.delayEvaluation()); - Assertions.assertEquals(660103653, model.evaluationInterval()); - } - - @Test - public void testSerialize() { - 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 ed5a272b1640f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.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.ModelContainerInner; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ModelContainerInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 17d3a1520a21f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.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.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ModelContainerPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 356013b36c1b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ModelContainerResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 53f65a7a78185..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 5085505683daf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.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.core.util.Context; -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", 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 b80dae1fda786..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.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.core.util.Context; -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, 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 758d3f629c93a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ModelVersionInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 70557b9231f8e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.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.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ModelVersionPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ff9723e25cd3c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ModelVersionResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ffe72063f79a7..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.core.util.Context; -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", 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 d5fc432d2f175..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.core.util.Context; -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", 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 d4fdeeb536806..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.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.core.util.Context; -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, - 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 998026ea8ef08..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.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.Mpi; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MpiTests { - @Test - public void testDeserialize() { - Mpi model = - BinaryData - .fromString("{\"distributionType\":\"Mpi\",\"processCountPerInstance\":589201934}") - .toObject(Mpi.class); - Assertions.assertEquals(589201934, model.processCountPerInstance()); - } - - @Test - public void testSerialize() { - 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 bd091c2029fd7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.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.NCrossValidations; -import org.junit.jupiter.api.Test; - -public final class NCrossValidationsTests { - @Test - public void testDeserialize() { - NCrossValidations model = - BinaryData.fromString("{\"mode\":\"NCrossValidations\"}").toObject(NCrossValidations.class); - } - - @Test - public void testSerialize() { - 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 a7505f12267ca..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.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.NlpVerticalFeaturizationSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NlpVerticalFeaturizationSettingsTests { - @Test - public void testDeserialize() { - NlpVerticalFeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"ns\"}").toObject(NlpVerticalFeaturizationSettings.class); - Assertions.assertEquals("ns", model.datasetLanguage()); - } - - @Test - public void testSerialize() { - 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 424fff6c23eda..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.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.NlpVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NlpVerticalLimitSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ec0ac4b8dec5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.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.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; -import org.junit.jupiter.api.Test; - -public final class NlpVerticalTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 7978ddf968fe3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.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.NodeStateCounts; -import org.junit.jupiter.api.Test; - -public final class NodeStateCountsTests { - @Test - public void testDeserialize() { - NodeStateCounts model = - BinaryData - .fromString( - "{\"idleNodeCount\":1191856604,\"runningNodeCount\":715935859,\"preparingNodeCount\":2047901283,\"unusableNodeCount\":1346181735,\"leavingNodeCount\":1358224808,\"preemptedNodeCount\":304822445}") - .toObject(NodeStateCounts.class); - } - - @Test - public void testSerialize() { - 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 ce9cbd1c1ec23..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.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.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NoneAuthTypeWorkspaceConnectionPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 d526044d0d7cc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.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.Goal; -import com.azure.resourcemanager.machinelearning.models.Objective; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ObjectiveTests { - @Test - public void testDeserialize() { - Objective model = - BinaryData - .fromString("{\"goal\":\"Minimize\",\"primaryMetric\":\"qxjoshohtotryeg\"}") - .toObject(Objective.class); - Assertions.assertEquals(Goal.MINIMIZE, model.goal()); - Assertions.assertEquals("qxjoshohtotryeg", model.primaryMetric()); - } - - @Test - public void testSerialize() { - 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 a7fc843b70342..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class OnlineDeploymentTrackedResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - OnlineDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"rprsnm\",\"value\":[{\"identity\":{\"principalId\":\"5c628002-faa9-4a82-845e-974fc80206b7\",\"tenantId\":\"1f1e8042-478e-4886-8068-3204bc3be0dc\",\"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\":\"94169cee-6d66-40f5-b3a0-b5787a2dfbb1\",\"tenantId\":\"db36f12c-7496-4557-abe6-429e89ec539b\",\"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\":\"f535ddac-d337-4577-8823-dc42c3f44ef1\",\"tenantId\":\"27776f68-6cbd-4bed-a997-e9519be4bdcb\",\"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\":\"fd5a699d-77d2-4e7f-a8b1-4c688ed81346\",\"tenantId\":\"1488bdb4-c5ce-4e55-8d5f-ef87b67ccaba\",\"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()); - } - - @Test - public void testSerialize() { - 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 4afd4d655bf2a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.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.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.core.util.Context; -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", 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 9c2418fdfda40..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.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.core.util.Context; -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), - 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 2ecda5de6a5b2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.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.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.core.util.Context; -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", 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 17313ac55ddb5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class OnlineEndpointTrackedResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - OnlineEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"hxgsrboldfor\",\"value\":[{\"identity\":{\"principalId\":\"dbadde6b-b3d0-4baf-93ca-8c9acfd27a56\",\"tenantId\":\"77ae172a-6fdd-4d2d-9eb1-286d18e176e3\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"fhfovv\",\"properties\":{\"compute\":\"qpbtuodxes\",\"provisioningState\":\"Creating\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"AADToken\",\"description\":\"umuaslzkwrrwoycq\",\"properties\":{},\"scoringUri\":\"http://example.org/hahnomdrkywuhps\",\"swaggerUri\":\"http://example.org/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\":\"3656211c-b57b-4e7d-9d0b-6624a99e3b8a\",\"tenantId\":\"dead8b25-242d-4110-84f1-3ebd366a7163\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"cgegydcwbo\",\"properties\":{\"compute\":\"umvq\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"traffic\":{},\"authMode\":\"AMLToken\",\"description\":\"iouaubrjt\",\"properties\":{},\"scoringUri\":\"http://example.org/fuojrngif\",\"swaggerUri\":\"http://example.org/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\":\"72fe6aba-f38b-431c-94e5-4f48b5a02773\",\"tenantId\":\"86ed68d3-a2b1-49e5-be26-427144736edb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"glqgleoh\",\"properties\":{\"compute\":\"etnluankrrfx\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"Key\",\"description\":\"acvbmqz\",\"properties\":{},\"scoringUri\":\"http://example.org/lajrnwxacevehj\",\"swaggerUri\":\"http://example.org/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()); - } - - @Test - public void testSerialize() { - 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 62f76689a8af2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.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.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.core.util.Context; -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", 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 2ec01f99303ed..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.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.OnlineRequestSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OnlineRequestSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 134750cc39eeb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.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.OnlineScaleSettings; -import org.junit.jupiter.api.Test; - -public final class OnlineScaleSettingsTests { - @Test - public void testDeserialize() { - OnlineScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"OnlineScaleSettings\"}").toObject(OnlineScaleSettings.class); - } - - @Test - public void testSerialize() { - 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 6506218c8f289..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.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.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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(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 a57678bea307f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.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.OutputPathAssetReference; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OutputPathAssetReferenceTests { - @Test - public void testDeserialize() { - OutputPathAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"OutputPath\",\"jobId\":\"h\",\"path\":\"mexznlwkb\"}") - .toObject(OutputPathAssetReference.class); - Assertions.assertEquals("h", model.jobId()); - Assertions.assertEquals("mexznlwkb", model.path()); - } - - @Test - public void testSerialize() { - 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 b8639a84074a6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PaginatedComputeResourcesListTests { - @Test - public void testDeserialize() { - PaginatedComputeResourcesList model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"cf195185-4217-478b-b351-1f336eefd75c\",\"tenantId\":\"c083b884-6118-45b0-9fb7-1981e198fd88\",\"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()); - } - - @Test - public void testSerialize() { - 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 812f4e84e66a8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.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.models.PartialBatchDeployment; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 f4715675d5c4d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.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.PartialBatchDeployment; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PartialBatchDeploymentTests { - @Test - public void testDeserialize() { - PartialBatchDeployment model = - BinaryData.fromString("{\"description\":\"wwa\"}").toObject(PartialBatchDeployment.class); - Assertions.assertEquals("wwa", model.description()); - } - - @Test - public void testSerialize() { - 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 72fe2eae3e66c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.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.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PartialManagedServiceIdentityTests { - @Test - public void testDeserialize() { - PartialManagedServiceIdentity model = - BinaryData - .fromString("{\"type\":\"None\",\"userAssignedIdentities\":{\"dtmhrkwofyyvoqa\":\"dataibahwflus\"}}") - .toObject(PartialManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @Test - public void testSerialize() { - 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 d0319bf2f1a51..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.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.PartialMinimalTrackedResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PartialMinimalTrackedResourceTests { - @Test - public void testDeserialize() { - PartialMinimalTrackedResource model = - BinaryData - .fromString("{\"tags\":{\"wbwo\":\"expbtg\",\"kcnqxwbpo\":\"nwashrtd\",\"aasipqi\":\"ulpiuj\"}}") - .toObject(PartialMinimalTrackedResource.class); - Assertions.assertEquals("expbtg", model.tags().get("wbwo")); - } - - @Test - public void testSerialize() { - 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 9acc5bc484fac..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PartialMinimalTrackedResourceWithIdentityTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 98f0b8b1c976a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PartialMinimalTrackedResourceWithSkuTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4a715ec709975..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.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.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PartialSkuTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4d6d4f995c15f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.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.Password; -import org.junit.jupiter.api.Test; - -public final class PasswordTests { - @Test - public void testDeserialize() { - Password model = - BinaryData.fromString("{\"name\":\"pgvdf\",\"value\":\"otkftutqxlngx\"}").toObject(Password.class); - } - - @Test - public void testSerialize() { - 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 94363c3294793..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.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.AssignedUser; -import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PersonalComputeInstanceSettingsTests { - @Test - public void testDeserialize() { - PersonalComputeInstanceSettings model = - BinaryData - .fromString("{\"assignedUser\":{\"objectId\":\"emc\",\"tenantId\":\"jk\"}}") - .toObject(PersonalComputeInstanceSettings.class); - Assertions.assertEquals("emc", model.assignedUser().objectId()); - Assertions.assertEquals("jk", model.assignedUser().tenantId()); - } - - @Test - public void testSerialize() { - 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 53e42e0f4235b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class PipelineJobTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 266998f3c8c00..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionInnerTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"pikxwczbyscnpqxu\",\"subnetArmId\":\"vyq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ybrk\",\"actionsRequired\":\"dumjgrtfwvuk\"},\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"679ad13e-4ce7-4ac1-b332-fd610e2ae1ed\",\"tenantId\":\"103e90a9-a65d-4b64-812c-0beee46ccce0\",\"type\":\"None\",\"userAssignedIdentities\":{\"jcny\":{\"principalId\":\"b58ae354-a091-459e-b4e0-c744a0a7df17\",\"clientId\":\"c2f3231c-2784-419e-a9d9-392e455134b0\"},\"kryhtnapczwlokj\":{\"principalId\":\"34133f8a-f3c4-4706-801d-b28b3341713d\",\"clientId\":\"3f18d784-fd03-4795-947d-623097d6e8d3\"},\"kkvnipjox\":{\"principalId\":\"6f96d215-1bc8-451c-93ee-ab2bed8b5be0\",\"clientId\":\"a7cf4ad5-d339-469d-b116-1fda2964a9d5\"}}},\"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()); - } - - @Test - public void testSerialize() { - 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 17709b36ed545..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionListResultTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"026a744a-c98e-4aab-b4e7-ac818d77a18c\",\"tenantId\":\"7569c5b1-e95a-4d11-8e70-6e6d9a77e25f\",\"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\":\"5db57d21-bf6d-450f-86c0-687725dd04c7\",\"tenantId\":\"2b72e0f8-fa03-451d-a9cc-b80f6ec6abc8\",\"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\":\"77d0c733-8a54-41fd-bdcd-11bfd4a16551\",\"tenantId\":\"c977224e-a2d8-42ca-8930-436410ec9d3e\",\"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\":\"78c7c93c-6b5d-4068-b6e4-7d2b2675e8f2\",\"tenantId\":\"71e1c700-78c4-4552-bf80-4784fbbd1bea\",\"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()); - } - - @Test - public void testSerialize() { - 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 5c48d1fcc31c5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 749a31b739b32..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\":\"e73625d8-d29e-49a3-971b-44974cf26956\",\"tenantId\":\"2522498b-6eb5-45a3-8c25-e82420742121\",\"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 550b886e26c3b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 16cad7cf3b7f8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.core.util.Context; -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\":\"f0d05010-dc6b-4342-ab89-3bac5448c571\",\"tenantId\":\"eb7548dd-c113-43c3-8b12-421c51033deb\",\"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", 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 820be4ed45185..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.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.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.core.util.Context; -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\":\"ad37b336-1fa7-4cf9-a9fe-91774cd71a48\",\"tenantId\":\"5e50acdd-a680-428a-98a7-445ef67259fb\",\"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", 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 cf23d9cff065d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.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.PrivateEndpoint; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointTests { - @Test - public void testDeserialize() { - PrivateEndpoint model = - BinaryData.fromString("{\"id\":\"elluwfziton\",\"subnetArmId\":\"qfpjk\"}").toObject(PrivateEndpoint.class); - } - - @Test - public void testSerialize() { - 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 68ba9ddf15aef..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceListResultInnerTests { - @Test - public void testDeserialize() { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"c\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"56c10707-d26e-4972-b340-ba7237c5c641\",\"tenantId\":\"f3b9487a-a146-4e03-b969-6c9b2522dabd\",\"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\":\"3cc330b5-3255-4ba2-a115-59e53a418761\",\"tenantId\":\"3678eda4-8264-4ccb-8cba-d5f55cda385c\",\"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\":\"32dee77e-4a3a-430b-9d66-fc1dc9be82c0\",\"tenantId\":\"3dcc36e2-21ba-4cea-8df9-16a4204532f4\",\"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()); - } - - @Test - public void testSerialize() { - 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 641aeac609426..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.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.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourcePropertiesTests { - @Test - public void testDeserialize() { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"ifthnz\",\"requiredMembers\":[\"sl\",\"nayqi\",\"ynduha\",\"hqlkthumaqo\"],\"requiredZoneNames\":[\"ycduier\",\"gccymvaolpssl\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ycduier", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - 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 8729ee14421b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceTests { - @Test - public void testDeserialize() { - PrivateLinkResource model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"yngudivk\",\"requiredMembers\":[\"wbxqzvszjfau\",\"j\"],\"requiredZoneNames\":[\"xivetvt\",\"qaqtdoqmcbxvwvxy\"]},\"identity\":{\"principalId\":\"32f0a15c-9d0f-4665-9934-dd004d9e6f37\",\"tenantId\":\"0a9fd039-af07-4b29-9ba3-2d6d8b7996bd\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"blytk\":{\"principalId\":\"93de6bf1-d4f0-45b0-ab30-b65f0cfcd897\",\"clientId\":\"010def7c-5866-4701-ae82-9aa1864bd83c\"},\"pe\":{\"principalId\":\"513a121e-f9cc-438a-b084-9dd3b75d2483\",\"clientId\":\"40270554-d298-4679-abab-ba14be614b55\"},\"fbkrvrnsvs\":{\"principalId\":\"97d20f73-ec05-42a1-8b26-532b85eb2531\",\"clientId\":\"1a51f6e4-679c-4a13-8557-202831ac364a\"}}},\"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)); - } - - @Test - public void testSerialize() { - 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 53de803da7b3d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.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.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.core.util.Context; -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", 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 8e01999bf5a87..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.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.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkServiceConnectionStateTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 7ed84494d27f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.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.ProbeSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ProbeSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 066e2ccdb96cd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.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.PyTorch; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PyTorchTests { - @Test - public void testDeserialize() { - PyTorch model = - BinaryData - .fromString("{\"distributionType\":\"PyTorch\",\"processCountPerInstance\":1314386445}") - .toObject(PyTorch.class); - Assertions.assertEquals(1314386445, model.processCountPerInstance()); - } - - @Test - public void testSerialize() { - 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 3dd3110e599d6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.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.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class QuotaBasePropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 73d34b664969b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.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.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; -import org.junit.jupiter.api.Test; - -public final class QuotaUpdateParametersTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5733ce5113230..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.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.core.util.Context; -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", 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 9204daeaaca45..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.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.core.util.Context; -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"), - 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 042269eada128..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.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.RandomSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.RandomSamplingAlgorithmRule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RandomSamplingAlgorithmTests { - @Test - public void testDeserialize() { - RandomSamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"Random\",\"rule\":\"Random\",\"seed\":1677252615}") - .toObject(RandomSamplingAlgorithm.class); - Assertions.assertEquals(RandomSamplingAlgorithmRule.RANDOM, model.rule()); - Assertions.assertEquals(1677252615, model.seed()); - } - - @Test - public void testSerialize() { - 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 5598599d577d5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.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.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RecurrenceScheduleTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 aef7fcf0cf37d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class RecurrenceTriggerTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 e03abef1a0615..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class RegressionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 d316e24d76858..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class RegressionTrainingSettingsTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 daf990742ac61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.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.ResourceBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceBaseTests { - @Test - public void testDeserialize() { - 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")); - } - - @Test - public void testSerialize() { - 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 5ca934d188dff..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.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.ResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceConfigurationTests { - @Test - public void testDeserialize() { - ResourceConfiguration model = - BinaryData - .fromString( - "{\"instanceCount\":1364369199,\"instanceType\":\"kgjubgdknnqvsazn\",\"properties\":{\"mkycgra\":\"dataorudsgsa\"}}") - .toObject(ResourceConfiguration.class); - Assertions.assertEquals(1364369199, model.instanceCount()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.instanceType()); - } - - @Test - public void testSerialize() { - 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 b01beafb89fb8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.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.ResourceId; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceIdTests { - @Test - public void testDeserialize() { - ResourceId model = BinaryData.fromString("{\"id\":\"gwgcl\"}").toObject(ResourceId.class); - Assertions.assertEquals("gwgcl", model.id()); - } - - @Test - public void testSerialize() { - 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 d89b6dc90af4f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.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.ResourceName; -import org.junit.jupiter.api.Test; - -public final class ResourceNameTests { - @Test - public void testDeserialize() { - ResourceName model = - BinaryData - .fromString("{\"value\":\"yqzrnkcqvyxlw\",\"localizedValue\":\"lsicohoqqnwv\"}") - .toObject(ResourceName.class); - } - - @Test - public void testSerialize() { - 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 209ccdb0df9ff..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.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.fluent.models.ResourceQuotaInner; -import org.junit.jupiter.api.Test; - -public final class ResourceQuotaInnerTests { - @Test - public void testDeserialize() { - ResourceQuotaInner model = - BinaryData - .fromString( - "{\"id\":\"bkh\",\"amlWorkspaceLocation\":\"deyeamdphagalpbu\",\"type\":\"gipwhonowkg\",\"name\":{\"value\":\"ankixzbinjeput\",\"localizedValue\":\"rywn\"},\"limit\":4868014576917618697,\"unit\":\"Count\"}") - .toObject(ResourceQuotaInner.class); - } - - @Test - public void testSerialize() { - 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 7bc984fe67b19..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.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.Route; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RouteTests { - @Test - public void testDeserialize() { - Route model = BinaryData.fromString("{\"path\":\"iykzkdncjdx\",\"port\":1933240221}").toObject(Route.class); - Assertions.assertEquals("iykzkdncjdx", model.path()); - Assertions.assertEquals(1933240221, model.port()); - } - - @Test - public void testSerialize() { - 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 c21224c11487b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.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.SamplingAlgorithm; -import org.junit.jupiter.api.Test; - -public final class SamplingAlgorithmTests { - @Test - public void testDeserialize() { - SamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"SamplingAlgorithm\"}") - .toObject(SamplingAlgorithm.class); - } - - @Test - public void testSerialize() { - 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 41a008c3ab9b1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.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.ScaleSettings; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScaleSettingsInformationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ad6f675ff1e6b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.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.ScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScaleSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 33d12eea8fd6f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.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.ScheduleActionBase; -import org.junit.jupiter.api.Test; - -public final class ScheduleActionBaseTests { - @Test - public void testDeserialize() { - ScheduleActionBase model = - BinaryData.fromString("{\"actionType\":\"ScheduleActionBase\"}").toObject(ScheduleActionBase.class); - } - - @Test - public void testSerialize() { - 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 6dfcdf7234d5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.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.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScheduleBaseTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 647c596477b4e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ScheduleInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 99c87825764e4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class SchedulePropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 0e5f38c896b96..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class ScheduleResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ba243239724b5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.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.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.core.util.Context; -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", 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 959b708528b6e..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.core.util.Context; -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", 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 b7faddc617c9b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.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.core.util.Context; -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, 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 cb300c6056e6e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.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.ScriptReference; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScriptReferenceTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4ac562f52a808..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.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.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScriptsToExecuteTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 8fbef06f4341f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.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.Seasonality; -import org.junit.jupiter.api.Test; - -public final class SeasonalityTests { - @Test - public void testDeserialize() { - Seasonality model = BinaryData.fromString("{\"mode\":\"Seasonality\"}").toObject(Seasonality.class); - } - - @Test - public void testSerialize() { - 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 73bfda891133f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.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.CosmosDbSettings; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ServiceManagedResourcesSettingsTests { - @Test - public void testDeserialize() { - ServiceManagedResourcesSettings model = - BinaryData - .fromString("{\"cosmosDb\":{\"collectionsThroughput\":775754231}}") - .toObject(ServiceManagedResourcesSettings.class); - Assertions.assertEquals(775754231, model.cosmosDb().collectionsThroughput()); - } - - @Test - public void testSerialize() { - 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 7fa18f24cee73..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.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.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import com.azure.resourcemanager.machinelearning.models.SetupScripts; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SetupScriptsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 22463ae895e4e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.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.fluent.models.SharedPrivateLinkResourceProperty; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SharedPrivateLinkResourcePropertyTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 d8f9b98cb604b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.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.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SharedPrivateLinkResourceTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 9735fe667d4cb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.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.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuCapacityTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 e50896deb331d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class SkuResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 02764cceb4648..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class SkuResourceInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ad587e2b34c8d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.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.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuSettingTests { - @Test - public void testDeserialize() { - SkuSetting model = - BinaryData.fromString("{\"name\":\"nnbsoqeqa\",\"tier\":\"Premium\"}").toObject(SkuSetting.class); - Assertions.assertEquals("nnbsoqeqa", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @Test - public void testSerialize() { - 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 76ce4f2f0747b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.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.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 94589405fca54..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.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.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class StackEnsembleSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 6719d62898c8a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.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.SweepJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SweepJobLimitsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 18629a088670d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.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.AutoPauseProperties; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SynapseSparkPropertiesTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 5ab350b5e4dd1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class SynapseSparkTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 3db2da5604aab..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.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.SystemService; -import org.junit.jupiter.api.Test; - -public final class SystemServiceTests { - @Test - public void testDeserialize() { - SystemService model = - BinaryData - .fromString( - "{\"systemServiceType\":\"gcgbjb\",\"publicIpAddress\":\"lfgtdysnaquflqbc\",\"version\":\"hamzjrwdkqze\"}") - .toObject(SystemService.class); - } - - @Test - public void testSerialize() { - 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 f1478ecc7d1ee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class TableVerticalFeaturizationSettingsTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 aca5954777556..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.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.TableVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TableVerticalLimitSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a2eb123c13052..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class TableVerticalTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 08e819f9fe131..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.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.TargetLags; -import org.junit.jupiter.api.Test; - -public final class TargetLagsTests { - @Test - public void testDeserialize() { - TargetLags model = BinaryData.fromString("{\"mode\":\"TargetLags\"}").toObject(TargetLags.class); - } - - @Test - public void testSerialize() { - 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 f0e9b587a8297..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.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.TargetRollingWindowSize; -import org.junit.jupiter.api.Test; - -public final class TargetRollingWindowSizeTests { - @Test - public void testDeserialize() { - TargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"TargetRollingWindowSize\"}").toObject(TargetRollingWindowSize.class); - } - - @Test - public void testSerialize() { - 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 75b158d61536b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.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.TargetUtilizationScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TargetUtilizationScaleSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 fcae090f0d111..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.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.TensorFlow; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TensorFlowTests { - @Test - public void testDeserialize() { - TensorFlow model = - BinaryData - .fromString( - "{\"distributionType\":\"TensorFlow\",\"parameterServerCount\":1873881024,\"workerCount\":131974478}") - .toObject(TensorFlow.class); - Assertions.assertEquals(1873881024, model.parameterServerCount()); - Assertions.assertEquals(131974478, model.workerCount()); - } - - @Test - public void testSerialize() { - 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 618534e33c1f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.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.TextClassificationMultilabel; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TextClassificationMultilabelTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 01141af72a8f3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.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.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; -import org.junit.jupiter.api.Test; - -public final class TextClassificationTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 336ac7a882618..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class TextNerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 b263d5a791c41..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.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.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; -import org.junit.jupiter.api.Test; - -public final class TrainingSettingsTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ea45d47431816..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.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.TriggerBase; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TriggerBaseTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 693c6159072d7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.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.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TritonModelJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 1cdb4dd2e3900..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.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.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobOutput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TritonModelJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a19d208a27017..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.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.TruncationSelectionPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TruncationSelectionPolicyTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 f3f4fab50c5ed..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.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.fluent.models.UpdateWorkspaceQuotasResultInner; -import org.junit.jupiter.api.Test; - -public final class UpdateWorkspaceQuotasResultInnerTests { - @Test - public void testDeserialize() { - 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); - } - - @Test - public void testSerialize() { - 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 2ff3558e955d4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.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.Status; -import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotas; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UpdateWorkspaceQuotasTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 7b7f950025f35..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.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.UriFileDataVersion; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UriFileDataVersionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 38cc2ec80d379..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.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.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UriFileJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 0e536cd589453..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.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.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UriFileJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 46876c6ef9ad5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code 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; -import org.junit.jupiter.api.Test; - -public final class UriFolderDataVersionTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 7de4ad8efb6e1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.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.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobInput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UriFolderJobInputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 a38d83aab88f9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.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.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobOutput; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UriFolderJobOutputTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ba30f5a5d07a8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.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.fluent.models.UsageInner; -import org.junit.jupiter.api.Test; - -public final class UsageInnerTests { - @Test - public void testDeserialize() { - UsageInner model = - BinaryData - .fromString( - "{\"id\":\"al\",\"amlWorkspaceLocation\":\"wsubisnja\",\"type\":\"mngnzscxaqw\",\"unit\":\"Count\",\"currentValue\":8284849522775064668,\"limit\":4293534997392812714,\"name\":{\"value\":\"kvlrxnj\",\"localizedValue\":\"seiphe\"}}") - .toObject(UsageInner.class); - } - - @Test - public void testSerialize() { - 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 8675acbfed900..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.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.UsageName; -import org.junit.jupiter.api.Test; - -public final class UsageNameTests { - @Test - public void testDeserialize() { - UsageName model = - BinaryData.fromString("{\"value\":\"lokeyy\",\"localizedValue\":\"nj\"}").toObject(UsageName.class); - } - - @Test - public void testSerialize() { - 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 484a3268f8a39..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.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.core.util.Context; -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", 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 87f7ffe8505f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.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.UserAssignedIdentity; -import org.junit.jupiter.api.Test; - -public final class UserAssignedIdentityTests { - @Test - public void testDeserialize() { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"1800db07-b48f-4242-81d2-188dacda3e06\",\"clientId\":\"8f926d0c-acdf-4a14-84c7-9877704a927c\"}") - .toObject(UserAssignedIdentity.class); - } - - @Test - public void testSerialize() { - 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 95a49276d7b43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.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.UserIdentity; -import org.junit.jupiter.api.Test; - -public final class UserIdentityTests { - @Test - public void testDeserialize() { - UserIdentity model = BinaryData.fromString("{\"identityType\":\"UserIdentity\"}").toObject(UserIdentity.class); - } - - @Test - public void testSerialize() { - 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 be0ead377a3b2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.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.VirtualMachineImage; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VirtualMachineImageTests { - @Test - public void testDeserialize() { - VirtualMachineImage model = - BinaryData.fromString("{\"id\":\"vbopfppdbwnu\"}").toObject(VirtualMachineImage.class); - Assertions.assertEquals("vbopfppdbwnu", model.id()); - } - - @Test - public void testSerialize() { - 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 16cdd7ffcd189..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class VirtualMachineSizeListResultInnerTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 08927d2994ee2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.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.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; -import org.junit.jupiter.api.Test; - -public final class VirtualMachineSizeTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 12fe4c0add316..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.core.util.Context; -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", 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 e06eeaa7e8ca7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.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.WorkspaceConnectionManagedIdentity; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionManagedIdentityTests { - @Test - public void testDeserialize() { - WorkspaceConnectionManagedIdentity model = - BinaryData - .fromString("{\"resourceId\":\"ivensrpmeyyvpk\",\"clientId\":\"tlbijpzg\"}") - .toObject(WorkspaceConnectionManagedIdentity.class); - Assertions.assertEquals("ivensrpmeyyvpk", model.resourceId()); - Assertions.assertEquals("tlbijpzg", model.clientId()); - } - - @Test - public void testSerialize() { - 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 5e46f1a9f2379..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.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.WorkspaceConnectionPersonalAccessToken; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionPersonalAccessTokenTests { - @Test - public void testDeserialize() { - WorkspaceConnectionPersonalAccessToken model = - BinaryData.fromString("{\"pat\":\"phuuuerctato\"}").toObject(WorkspaceConnectionPersonalAccessToken.class); - Assertions.assertEquals("phuuuerctato", model.pat()); - } - - @Test - public void testSerialize() { - 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 2e22297065e17..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.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.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; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 688478478da1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionPropertiesV2BasicResourceInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 ddf62f40a4967..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.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.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionPropertiesV2Tests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4061b86f9e738..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.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.WorkspaceConnectionSharedAccessSignature; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkspaceConnectionSharedAccessSignatureTests { - @Test - public void testDeserialize() { - WorkspaceConnectionSharedAccessSignature model = - BinaryData - .fromString("{\"sas\":\"uczkgofxyfsruc\"}") - .toObject(WorkspaceConnectionSharedAccessSignature.class); - Assertions.assertEquals("uczkgofxyfsruc", model.sas()); - } - - @Test - public void testSerialize() { - 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 4424e5e67efeb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.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.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.core.util.Context; -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", 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 3d95cd3c20eda..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.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.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.core.util.Context; -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", 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 6c267337116a9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.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.core.util.Context; -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", 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 3296f73981ac6..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.core.util.Context; -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", 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 6612f516eade4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.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.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; -import org.junit.jupiter.api.Test; - -public final class WorkspacePropertiesUpdateParametersTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 251df4468625e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.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.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; -import org.junit.jupiter.api.Test; - -public final class WorkspaceUpdateParametersTests { - @Test - public void testDeserialize() { - WorkspaceUpdateParameters model = - BinaryData - .fromString( - "{\"tags\":{\"yqduujit\":\"mgxsab\",\"rwpdappdsbdkvwrw\":\"jczdzevndh\"},\"sku\":{\"name\":\"eusnhutj\",\"tier\":\"Premium\",\"size\":\"rl\",\"family\":\"ugjzzdatqxhocdge\",\"capacity\":1293628182},\"identity\":{\"principalId\":\"487aecd4-d701-4fcd-96e2-191149be5eac\",\"tenantId\":\"539dedbd-00b4-49d6-be46-f81de827404d\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"dvkaozw\":{\"principalId\":\"ad4614b5-7bf6-42b7-a901-4aaeb4103000\",\"clientId\":\"f9eec783-beb4-4338-9f38-95ae1d1625bb\"},\"tyhxhurokft\":{\"principalId\":\"ce579e9b-427b-45dc-ba60-9daff56da2b3\",\"clientId\":\"e645ea8d-ce6c-451e-b125-7adbbb09b71e\"},\"lniwpwcukjfkgiaw\":{\"principalId\":\"d4b52704-b742-4a18-813a-920133a52053\",\"clientId\":\"15f2e38e-ed64-499d-a596-2c2a42cc20a1\"},\"ryplwckbasyypn\":{\"principalId\":\"ec6fccd5-ffaa-4fc2-92e2-2669593b65b3\",\"clientId\":\"3eceb606-78dd-4ad2-90ab-a6c20e0c0c41\"}}},\"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()); - } - - @Test - public void testSerialize() { - 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 04b76c351bad4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.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.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.core.util.Context; -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", 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 3bb92b2b4be41..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.core.util.Context; -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", 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 cf7727a6e6493..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.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.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.core.util.Context; -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", Context.NONE); - } -}