diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5c15727540dd..11f5a7d5cc75 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -483,6 +483,7 @@ com.azure.resourcemanager:azure-resourcemanager-programmableconnectivity;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-manufacturingplatform;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index a0c18e0cb24e..66970b21cb26 100644 --- a/pom.xml +++ b/pom.xml @@ -143,6 +143,7 @@ sdk/managedapplications sdk/managednetworkfabric sdk/managementgroups + sdk/manufacturingplatform sdk/maps sdk/mariadb sdk/marketplaceordering diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/CHANGELOG.md b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/CHANGELOG.md new file mode 100644 index 000000000000..772ddc30a34e --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-05-12) + +- Azure Resource Manager manufacturingplatform client library for Java. This package contains Microsoft Azure SDK for manufacturingplatform Management SDK. Package tag package-2024-02-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-manufacturingplatform Java SDK. diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/README.md b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/README.md new file mode 100644 index 000000000000..cc6f387376be --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager manufacturingplatform client library for Java + +Azure Resource Manager manufacturingplatform client library for Java. + +This package contains Microsoft Azure SDK for manufacturingplatform Management SDK. Package tag package-2024-02-01-preview. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-manufacturingplatform;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-manufacturingplatform + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ManufacturingplatformManager manager = ManufacturingplatformManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/SAMPLE.md b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/SAMPLE.md new file mode 100644 index 000000000000..93c10869ee0b --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/SAMPLE.md @@ -0,0 +1,367 @@ +# Code snippets and samples + + +## ManufacturingDataServices + +- [CreateOrUpdate](#manufacturingdataservices_createorupdate) +- [Delete](#manufacturingdataservices_delete) +- [GetByResourceGroup](#manufacturingdataservices_getbyresourcegroup) +- [List](#manufacturingdataservices_list) +- [ListAvailableVersions](#manufacturingdataservices_listavailableversions) +- [ListByResourceGroup](#manufacturingdataservices_listbyresourcegroup) +- [Update](#manufacturingdataservices_update) + +## Operations + +- [List](#operations_list) +### ManufacturingDataServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.manufacturingplatform.models.AmlProfile; +import com.azure.resourcemanager.manufacturingplatform.models.CmkProfile; +import com.azure.resourcemanager.manufacturingplatform.models.DenyAssignmentExclusion; +import com.azure.resourcemanager.manufacturingplatform.models.FabricProfile; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceProperties; +import com.azure.resourcemanager.manufacturingplatform.models.OpenAIProfile; +import com.azure.resourcemanager.manufacturingplatform.models.RedundancyState; +import com.azure.resourcemanager.manufacturingplatform.models.ResourceState; +import com.azure.resourcemanager.manufacturingplatform.models.Sku; +import com.azure.resourcemanager.manufacturingplatform.models.SkuTier; +import com.azure.resourcemanager.manufacturingplatform.models.UserAssignedIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedAdxProfile; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedDatabaseProfile; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedOpenAIProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManufacturingDataServices CreateOrUpdate. + */ +public final class ManufacturingDataServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesCreateOrUpdateMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .define("-JC180-G53HQ-DV45--2") + .withRegion("gbr") + .withExistingResourceGroup("rgmanufacturingplatform") + .withTags(mapOf("key6832", "fakeTokenPlaceholder")) + .withProperties(new MdsResourceProperties().withVersion("syxboqeykgkjfooouymjnqjylnmkct") + .withEnableTeamsNotification(true) + .withEnableCopilot(true) + .withEnableDiagnosticSettings(true) + .withAadApplicationId("cBaEC5DF-CEaB-Ddae-ecbD-1Afabbd6DAe3") + .withAksAdminGroupId("dccAbeC7-84Eb-cbde-02Bd-B2cdfcaebb0D") + .withContinuousExportPeriod(12) + .withOpenAIProfile(new OpenAIProfile().withGptModelName("oclkeq") + .withGptModelVersion("paewwsvlhp") + .withGptModelCapacity(25) + .withGptModelSkuName("uuy") + .withEmbeddingModelName("xdqqhveootydkaed") + .withEmbeddingModelVersion("dddrtaedlevdqosxap") + .withEmbeddingModelSkuName("pdyhughmmkwmajeqlseuuydox") + .withEmbeddingModelCapacity(30)) + .withAmlProfile(new AmlProfile().withId("kunnf").withCustomNerServiceUri("ehvipfretszmxwelqee")) + .withUserManagedDatabaseProfile(new UserManagedDatabaseProfile().withCosmosId("sctcjvwhklehlk")) + .withUserManagedAdxProfile(new UserManagedAdxProfile().withId("wnmjzrhearzsdhveoadpag")) + .withCmkProfile(new CmkProfile().withKeyUri("fakeTokenPlaceholder")) + .withFabricProfile(new FabricProfile().withKeyUri("fakeTokenPlaceholder") + .withOneLakeUri("aamkzbolxdjqdptjiruahrl") + .withOneLakePath("hlcjgvamgtvmnxlcg")) + .withUserManagedOpenAIProfile(new UserManagedOpenAIProfile().withId("cqn") + .withGptModelDeploymentName("llyqusnsz") + .withEmbeddingModelDeploymentName("hybrb")) + .withDenyAssignmentExclusions(Arrays.asList( + new DenyAssignmentExclusion().withId("adxldjrbyhdovyxt").withType("tswtczntehsdxgmwkjmlffbkkkar"))) + .withResourceState(ResourceState.ACTIVE) + .withRedundancyState(RedundancyState.ZONAL)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key767", new UserAssignedIdentity()))) + .withSku(new Sku().withName("dfkkduhajxuswqtoyx") + .withTier(SkuTier.FREE) + .withSize("lunqammlzxjdvucllokewclfndgcp") + .withFamily("onfpel") + .withCapacity(3)) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ManufacturingDataServices_Delete + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ManufacturingDataServices_GetByResourceGroup + +```java +/** + * Samples for ManufacturingDataServices Delete. + */ +public final class ManufacturingDataServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Delete_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesDeleteMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .delete("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", com.azure.core.util.Context.NONE); + } +} +``` + +### ManufacturingDataServices_List + +```java +/** + * Samples for ManufacturingDataServices List. + */ +public final class ManufacturingDataServicesListSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListBySubscription_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListBySubscriptionMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ManufacturingDataServices_ListAvailableVersions + +```java +/** + * Samples for ManufacturingDataServices ListAvailableVersions. + */ +public final class ManufacturingDataServicesListAvailableVersionsSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListAvailableVersions_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListAvailableVersions_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListAvailableVersionsMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .listAvailableVersionsWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManufacturingDataServices_ListByResourceGroup + +```java +/** + * Samples for ManufacturingDataServices GetByResourceGroup. + */ +public final class ManufacturingDataServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Get_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesGetMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .getByResourceGroupWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManufacturingDataServices_Update + +```java +import com.azure.resourcemanager.manufacturingplatform.models.AmlProfileUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesSkuUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.DenyAssignmentExclusion; +import com.azure.resourcemanager.manufacturingplatform.models.FabricProfileUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResource; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdateProperties; +import com.azure.resourcemanager.manufacturingplatform.models.OpenAIProfile; +import com.azure.resourcemanager.manufacturingplatform.models.ResourceState; +import com.azure.resourcemanager.manufacturingplatform.models.SkuTier; +import com.azure.resourcemanager.manufacturingplatform.models.UserAssignedIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedOpenAIProfileUpdate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManufacturingDataServices Update. + */ +public final class ManufacturingDataServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Update_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesUpdateMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + MdsResource resource = manager.manufacturingDataServices() + .getByResourceGroupWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key8765", "fakeTokenPlaceholder")) + .withIdentity(new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key5851", new UserAssignedIdentity()))) + .withSku(new AzureResourceManagerCommonTypesSkuUpdate().withName("rbwukuvzskhsarruzdkpxkjekxbc") + .withTier(SkuTier.FREE) + .withSize("ulsrkxmhtvulceyyzmknprvsyw") + .withFamily("uurphlxfxgzud") + .withCapacity(12)) + .withProperties(new MdsResourceUpdateProperties().withVersion("uihmagrnpqkkbjtsohqgyoxmoyrtg") + .withEnableTeamsNotification(true) + .withEnableCopilot(true) + .withEnableDiagnosticSettings(true) + .withOpenAIProfile(new OpenAIProfile().withGptModelName("oclkeq") + .withGptModelVersion("paewwsvlhp") + .withGptModelCapacity(25) + .withGptModelSkuName("uuy") + .withEmbeddingModelName("xdqqhveootydkaed") + .withEmbeddingModelVersion("dddrtaedlevdqosxap") + .withEmbeddingModelSkuName("pdyhughmmkwmajeqlseuuydox") + .withEmbeddingModelCapacity(30)) + .withAmlProfile(new AmlProfileUpdate().withId("qjr").withCustomNerServiceUri("vcnedenz")) + .withFabricProfile(new FabricProfileUpdate().withKeyUri("fakeTokenPlaceholder") + .withOneLakeUri("cbtxruhkzmsvxavtwp") + .withOneLakePath("wyxwdawtwcsuwyu")) + .withUserManagedOpenAIProfile(new UserManagedOpenAIProfileUpdate().withId("pbpgcwghuullcbapcpxllffkri") + .withGptModelDeploymentName("evqxxkkeguvpujjxwv") + .withEmbeddingModelDeploymentName("aofhgjrzwvlj")) + .withDenyAssignmentExclusions(Arrays.asList( + new DenyAssignmentExclusion().withId("adxldjrbyhdovyxt").withType("tswtczntehsdxgmwkjmlffbkkkar"))) + .withResourceState(ResourceState.ACTIVE)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** + * Samples for ManufacturingDataServices ListByResourceGroup. + */ +public final class ManufacturingDataServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListByResourceGroupMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .listByResourceGroup("rgmanufacturingplatform", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/pom.xml b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/pom.xml new file mode 100644 index 000000000000..33e367950cef --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-manufacturingplatform + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for manufacturingplatform Management + This package contains Microsoft Azure SDK for manufacturingplatform Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-02-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/ManufacturingplatformManager.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/ManufacturingplatformManager.java new file mode 100644 index 000000000000..c21ed4e3a5bd --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/ManufacturingplatformManager.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.manufacturingplatform.fluent.MicrosoftManufacturingPlatform; +import com.azure.resourcemanager.manufacturingplatform.implementation.ManufacturingDataServicesImpl; +import com.azure.resourcemanager.manufacturingplatform.implementation.MicrosoftManufacturingPlatformBuilder; +import com.azure.resourcemanager.manufacturingplatform.implementation.OperationsImpl; +import com.azure.resourcemanager.manufacturingplatform.models.ManufacturingDataServices; +import com.azure.resourcemanager.manufacturingplatform.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ManufacturingplatformManager. + */ +public final class ManufacturingplatformManager { + private Operations operations; + + private ManufacturingDataServices manufacturingDataServices; + + private final MicrosoftManufacturingPlatform clientObject; + + private ManufacturingplatformManager(HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new MicrosoftManufacturingPlatformBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of manufacturingplatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the manufacturingplatform service API instance. + */ + public static ManufacturingplatformManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of manufacturingplatform service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the manufacturingplatform service API instance. + */ + public static ManufacturingplatformManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ManufacturingplatformManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ManufacturingplatformManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ManufacturingplatformManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-manufacturingplatform.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of manufacturingplatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the manufacturingplatform service API instance. + */ + public ManufacturingplatformManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.manufacturingplatform") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ManufacturingplatformManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of ManufacturingDataServices. It manages MdsResource. + * + * @return Resource collection API of ManufacturingDataServices. + */ + public ManufacturingDataServices manufacturingDataServices() { + if (this.manufacturingDataServices == null) { + this.manufacturingDataServices + = new ManufacturingDataServicesImpl(clientObject.getManufacturingDataServices(), this); + } + return manufacturingDataServices; + } + + /** + * Gets wrapped service client MicrosoftManufacturingPlatform providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client MicrosoftManufacturingPlatform. + */ + public MicrosoftManufacturingPlatform serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/ManufacturingDataServicesClient.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/ManufacturingDataServicesClient.java new file mode 100644 index 000000000000..5e44eb7523e5 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/ManufacturingDataServicesClient.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.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.manufacturingplatform.fluent.models.AvailableVersionListResultInner; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in ManufacturingDataServicesClient. + */ +public interface ManufacturingDataServicesClient { + /** + * List MdsResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException 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 of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List MdsResource resources by subscription 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 response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MdsResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MdsResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String mdsResourceName, + Context context); + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MdsResourceInner getByResourceGroup(String resourceGroupName, String mdsResourceName); + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MdsResourceInner> beginCreateOrUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceInner resource); + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MdsResourceInner> beginCreateOrUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceInner resource, Context context); + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MdsResourceInner createOrUpdate(String resourceGroupName, String mdsResourceName, MdsResourceInner resource); + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MdsResourceInner createOrUpdate(String resourceGroupName, String mdsResourceName, MdsResourceInner resource, + Context context); + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MdsResourceInner> beginUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceUpdate properties); + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MdsResourceInner> beginUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceUpdate properties, Context context); + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MdsResourceInner update(String resourceGroupName, String mdsResourceName, MdsResourceUpdate properties); + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MdsResourceInner update(String resourceGroupName, String mdsResourceName, MdsResourceUpdate properties, + Context context); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName, Context context); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName, Context context); + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableVersionsWithResponse(String resourceGroupName, + String mdsResourceName, Context context); + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableVersionListResultInner listAvailableVersions(String resourceGroupName, String mdsResourceName); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/MicrosoftManufacturingPlatform.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/MicrosoftManufacturingPlatform.java new file mode 100644 index 000000000000..4f5dc1e085f1 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/MicrosoftManufacturingPlatform.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for MicrosoftManufacturingPlatform class. + */ +public interface MicrosoftManufacturingPlatform { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ManufacturingDataServicesClient object to access its operations. + * + * @return the ManufacturingDataServicesClient object. + */ + ManufacturingDataServicesClient getManufacturingDataServices(); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/OperationsClient.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/OperationsClient.java new file mode 100644 index 000000000000..4fed88889e21 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/AvailableVersionListResultInner.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/AvailableVersionListResultInner.java new file mode 100644 index 000000000000..2fbb6db65971 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/AvailableVersionListResultInner.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.manufacturingplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.manufacturingplatform.models.ApplicationVersion; +import java.io.IOException; +import java.util.List; + +/** + * The list of available versions. + */ +@Fluent +public final class AvailableVersionListResultInner implements JsonSerializable { + /* + * The list of versions + */ + private List versions; + + /** + * Creates an instance of AvailableVersionListResultInner class. + */ + public AvailableVersionListResultInner() { + } + + /** + * Get the versions property: The list of versions. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Set the versions property: The list of versions. + * + * @param versions the versions value to set. + * @return the AvailableVersionListResultInner object itself. + */ + public AvailableVersionListResultInner withVersions(List versions) { + this.versions = versions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property versions in model AvailableVersionListResultInner")); + } else { + versions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableVersionListResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("versions", this.versions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableVersionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableVersionListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AvailableVersionListResultInner. + */ + public static AvailableVersionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableVersionListResultInner deserializedAvailableVersionListResultInner + = new AvailableVersionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("versions".equals(fieldName)) { + List versions + = reader.readArray(reader1 -> ApplicationVersion.fromJson(reader1)); + deserializedAvailableVersionListResultInner.versions = versions; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableVersionListResultInner; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/MdsResourceInner.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/MdsResourceInner.java new file mode 100644 index 000000000000..6c227d01b55d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/MdsResourceInner.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceProperties; +import com.azure.resourcemanager.manufacturingplatform.models.Sku; +import java.io.IOException; +import java.util.Map; + +/** + * A ManufacturingPlatformProviderHub resource. + */ +@Fluent +public final class MdsResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private MdsResourceProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MdsResourceInner class. + */ + public MdsResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MdsResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MdsResourceInner object itself. + */ + public MdsResourceInner withProperties(MdsResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the MdsResourceInner object itself. + */ + public MdsResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @param sku the sku value to set. + * @return the MdsResourceInner object itself. + */ + public MdsResourceInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public MdsResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MdsResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MdsResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MdsResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MdsResourceInner. + */ + public static MdsResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MdsResourceInner deserializedMdsResourceInner = new MdsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMdsResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMdsResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMdsResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMdsResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMdsResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMdsResourceInner.properties = MdsResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedMdsResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedMdsResourceInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMdsResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMdsResourceInner; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/OperationInner.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/OperationInner.java new file mode 100644 index 000000000000..db46bae8a6ef --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/OperationInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.manufacturingplatform.models.ActionType; +import com.azure.resourcemanager.manufacturingplatform.models.OperationDisplay; +import com.azure.resourcemanager.manufacturingplatform.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/package-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/package-info.java new file mode 100644 index 000000000000..60346d1b9084 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for MicrosoftManufacturingPlatform. + * null. + */ +package com.azure.resourcemanager.manufacturingplatform.fluent.models; diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/package-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/package-info.java new file mode 100644 index 000000000000..d1cf1ccc2192 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for MicrosoftManufacturingPlatform. + * null. + */ +package com.azure.resourcemanager.manufacturingplatform.fluent; diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/AvailableVersionListResultImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/AvailableVersionListResultImpl.java new file mode 100644 index 000000000000..31df9725a801 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/AvailableVersionListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.resourcemanager.manufacturingplatform.fluent.models.AvailableVersionListResultInner; +import com.azure.resourcemanager.manufacturingplatform.models.ApplicationVersion; +import com.azure.resourcemanager.manufacturingplatform.models.AvailableVersionListResult; +import java.util.Collections; +import java.util.List; + +public final class AvailableVersionListResultImpl implements AvailableVersionListResult { + private AvailableVersionListResultInner innerObject; + + private final com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager; + + AvailableVersionListResultImpl(AvailableVersionListResultInner innerObject, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List versions() { + List inner = this.innerModel().versions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableVersionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesClientImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesClientImpl.java new file mode 100644 index 000000000000..b6abba49a822 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesClientImpl.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.manufacturingplatform.fluent.ManufacturingDataServicesClient; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.AvailableVersionListResultInner; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceListResult; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdate; +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 ManufacturingDataServicesClient. + */ +public final class ManufacturingDataServicesClientImpl implements ManufacturingDataServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManufacturingDataServicesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftManufacturingPlatformImpl client; + + /** + * Initializes an instance of ManufacturingDataServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManufacturingDataServicesClientImpl(MicrosoftManufacturingPlatformImpl client) { + this.service = RestProxy.create(ManufacturingDataServicesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftManufacturingPlatformManufacturingDataServices to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftManufacturi") + public interface ManufacturingDataServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, + @BodyParam("application/json") MdsResourceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, + @BodyParam("application/json") MdsResourceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, + @BodyParam("application/json") MdsResourceUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, + @BodyParam("application/json") MdsResourceUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}/listAvailableVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableVersions(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManufacturingPlatform/manufacturingDataServices/{mdsResourceName}/listAvailableVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAvailableVersionsSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mdsResourceName") String mdsResourceName, @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) + Response listBySubscriptionNextSync( + @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> listByResourceGroupNext( + @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) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List MdsResource resources by subscription ID. + * + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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 MdsResource resources by subscription ID. + * + * @throws ManagementException 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 of a MdsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List MdsResource resources by subscription ID. + * + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List MdsResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List MdsResource resources by subscription ID. + * + * @throws ManagementException 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 of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List MdsResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * List MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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 MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List MdsResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List MdsResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String mdsResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String mdsResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, mdsResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String mdsResourceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context); + } + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MdsResourceInner getByResourceGroup(String resourceGroupName, String mdsResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, Context.NONE).getValue(); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String mdsResourceName, MdsResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String mdsResourceName, + MdsResourceInner resource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, resource, accept, Context.NONE); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String mdsResourceName, + MdsResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, resource, accept, context); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MdsResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String mdsResourceName, MdsResourceInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, mdsResourceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MdsResourceInner.class, MdsResourceInner.class, this.client.getContext()); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MdsResourceInner> beginCreateOrUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, mdsResourceName, resource); + return this.client.getLroResult(response, MdsResourceInner.class, + MdsResourceInner.class, Context.NONE); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MdsResourceInner> beginCreateOrUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, mdsResourceName, resource, context); + return this.client.getLroResult(response, MdsResourceInner.class, + MdsResourceInner.class, context); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String mdsResourceName, + MdsResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, mdsResourceName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MdsResourceInner createOrUpdate(String resourceGroupName, String mdsResourceName, + MdsResourceInner resource) { + return beginCreateOrUpdate(resourceGroupName, mdsResourceName, resource).getFinalResult(); + } + + /** + * Create a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MdsResourceInner createOrUpdate(String resourceGroupName, String mdsResourceName, MdsResourceInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, mdsResourceName, resource, context).getFinalResult(); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String mdsResourceName, + MdsResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String mdsResourceName, + MdsResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, properties, accept, Context.NONE); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String mdsResourceName, + MdsResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, properties, accept, context); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MdsResourceInner> beginUpdateAsync(String resourceGroupName, + String mdsResourceName, MdsResourceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, mdsResourceName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MdsResourceInner.class, MdsResourceInner.class, this.client.getContext()); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MdsResourceInner> beginUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceUpdate properties) { + Response response = updateWithResponse(resourceGroupName, mdsResourceName, properties); + return this.client.getLroResult(response, MdsResourceInner.class, + MdsResourceInner.class, Context.NONE); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MdsResourceInner> beginUpdate(String resourceGroupName, + String mdsResourceName, MdsResourceUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, mdsResourceName, properties, context); + return this.client.getLroResult(response, MdsResourceInner.class, + MdsResourceInner.class, context); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String mdsResourceName, + MdsResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, mdsResourceName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MdsResourceInner update(String resourceGroupName, String mdsResourceName, MdsResourceUpdate properties) { + return beginUpdate(resourceGroupName, mdsResourceName, properties).getFinalResult(); + } + + /** + * Update a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ManufacturingPlatformProviderHub resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MdsResourceInner update(String resourceGroupName, String mdsResourceName, MdsResourceUpdate properties, + Context context) { + return beginUpdate(resourceGroupName, mdsResourceName, properties, context).getFinalResult(); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String mdsResourceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, Context.NONE); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String mdsResourceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, mdsResourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName) { + Response response = deleteWithResponse(resourceGroupName, mdsResourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, mdsResourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName) { + return beginDeleteAsync(resourceGroupName, mdsResourceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName) { + beginDelete(resourceGroupName, mdsResourceName).getFinalResult(); + } + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName, Context context) { + beginDelete(resourceGroupName, mdsResourceName, context).getFinalResult(); + } + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableVersionsWithResponseAsync(String resourceGroupName, String mdsResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAvailableVersions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableVersionsAsync(String resourceGroupName, + String mdsResourceName) { + return listAvailableVersionsWithResponseAsync(resourceGroupName, mdsResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableVersionsWithResponse(String resourceGroupName, + String mdsResourceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mdsResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter mdsResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listAvailableVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, mdsResourceName, accept, context); + } + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableVersionListResultInner listAvailableVersions(String resourceGroupName, String mdsResourceName) { + return listAvailableVersionsWithResponse(resourceGroupName, mdsResourceName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a MdsResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(ManufacturingDataServicesClientImpl.class); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesImpl.java new file mode 100644 index 000000000000..520d87715371 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ManufacturingDataServicesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.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.manufacturingplatform.fluent.ManufacturingDataServicesClient; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.AvailableVersionListResultInner; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import com.azure.resourcemanager.manufacturingplatform.models.AvailableVersionListResult; +import com.azure.resourcemanager.manufacturingplatform.models.ManufacturingDataServices; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResource; + +public final class ManufacturingDataServicesImpl implements ManufacturingDataServices { + private static final ClientLogger LOGGER = new ClientLogger(ManufacturingDataServicesImpl.class); + + private final ManufacturingDataServicesClient innerClient; + + private final com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager; + + public ManufacturingDataServicesImpl(ManufacturingDataServicesClient innerClient, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MdsResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MdsResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MdsResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MdsResourceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String mdsResourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MdsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MdsResource getByResourceGroup(String resourceGroupName, String mdsResourceName) { + MdsResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, mdsResourceName); + if (inner != null) { + return new MdsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String mdsResourceName) { + this.serviceClient().delete(resourceGroupName, mdsResourceName); + } + + public void delete(String resourceGroupName, String mdsResourceName, Context context) { + this.serviceClient().delete(resourceGroupName, mdsResourceName, context); + } + + public Response listAvailableVersionsWithResponse(String resourceGroupName, + String mdsResourceName, Context context) { + Response inner + = this.serviceClient().listAvailableVersionsWithResponse(resourceGroupName, mdsResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvailableVersionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvailableVersionListResult listAvailableVersions(String resourceGroupName, String mdsResourceName) { + AvailableVersionListResultInner inner + = this.serviceClient().listAvailableVersions(resourceGroupName, mdsResourceName); + if (inner != null) { + return new AvailableVersionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MdsResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 mdsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "manufacturingDataServices"); + if (mdsResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'manufacturingDataServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 mdsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "manufacturingDataServices"); + if (mdsResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'manufacturingDataServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 mdsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "manufacturingDataServices"); + if (mdsResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'manufacturingDataServices'.", id))); + } + this.delete(resourceGroupName, mdsResourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 mdsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "manufacturingDataServices"); + if (mdsResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'manufacturingDataServices'.", id))); + } + this.delete(resourceGroupName, mdsResourceName, context); + } + + private ManufacturingDataServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager() { + return this.serviceManager; + } + + public MdsResourceImpl define(String name) { + return new MdsResourceImpl(name, this.manager()); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MdsResourceImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MdsResourceImpl.java new file mode 100644 index 000000000000..035d25d4cc86 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MdsResourceImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import com.azure.resourcemanager.manufacturingplatform.models.AvailableVersionListResult; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesSkuUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResource; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceProperties; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdateProperties; +import com.azure.resourcemanager.manufacturingplatform.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class MdsResourceImpl implements MdsResource, MdsResource.Definition, MdsResource.Update { + private MdsResourceInner innerObject; + + private final com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager 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 MdsResourceProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + 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 MdsResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mdsResourceName; + + private MdsResourceUpdate updateProperties; + + public MdsResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MdsResource create() { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .createOrUpdate(resourceGroupName, mdsResourceName, this.innerModel(), Context.NONE); + return this; + } + + public MdsResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .createOrUpdate(resourceGroupName, mdsResourceName, this.innerModel(), context); + return this; + } + + MdsResourceImpl(String name, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerObject = new MdsResourceInner(); + this.serviceManager = serviceManager; + this.mdsResourceName = name; + } + + public MdsResourceImpl update() { + this.updateProperties = new MdsResourceUpdate(); + return this; + } + + public MdsResource apply() { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .update(resourceGroupName, mdsResourceName, updateProperties, Context.NONE); + return this; + } + + public MdsResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .update(resourceGroupName, mdsResourceName, updateProperties, context); + return this; + } + + MdsResourceImpl(MdsResourceInner innerObject, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mdsResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "manufacturingDataServices"); + } + + public MdsResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, Context.NONE) + .getValue(); + return this; + } + + public MdsResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManufacturingDataServices() + .getByResourceGroupWithResponse(resourceGroupName, mdsResourceName, context) + .getValue(); + return this; + } + + public Response listAvailableVersionsWithResponse(Context context) { + return serviceManager.manufacturingDataServices() + .listAvailableVersionsWithResponse(resourceGroupName, mdsResourceName, context); + } + + public AvailableVersionListResult listAvailableVersions() { + return serviceManager.manufacturingDataServices().listAvailableVersions(resourceGroupName, mdsResourceName); + } + + public MdsResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MdsResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MdsResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public MdsResourceImpl withProperties(MdsResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public MdsResourceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public MdsResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public MdsResourceImpl withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity) { + this.updateProperties.withIdentity(identity); + return this; + } + + public MdsResourceImpl withSku(AzureResourceManagerCommonTypesSkuUpdate sku) { + this.updateProperties.withSku(sku); + return this; + } + + public MdsResourceImpl withProperties(MdsResourceUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformBuilder.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformBuilder.java new file mode 100644 index 000000000000..08db757db1ae --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the MicrosoftManufacturingPlatformImpl type. + */ +@ServiceClientBuilder(serviceClients = { MicrosoftManufacturingPlatformImpl.class }) +public final class MicrosoftManufacturingPlatformBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the MicrosoftManufacturingPlatformBuilder. + */ + public MicrosoftManufacturingPlatformBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MicrosoftManufacturingPlatformImpl with the provided parameters. + * + * @return an instance of MicrosoftManufacturingPlatformImpl. + */ + public MicrosoftManufacturingPlatformImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MicrosoftManufacturingPlatformImpl client = new MicrosoftManufacturingPlatformImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformImpl.java new file mode 100644 index 000000000000..0a24ecb4da22 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/MicrosoftManufacturingPlatformImpl.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.manufacturingplatform.fluent.ManufacturingDataServicesClient; +import com.azure.resourcemanager.manufacturingplatform.fluent.MicrosoftManufacturingPlatform; +import com.azure.resourcemanager.manufacturingplatform.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the MicrosoftManufacturingPlatformImpl type. + */ +@ServiceClient(builder = MicrosoftManufacturingPlatformBuilder.class) +public final class MicrosoftManufacturingPlatformImpl implements MicrosoftManufacturingPlatform { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The ManufacturingDataServicesClient object to access its operations. + */ + private final ManufacturingDataServicesClient manufacturingDataServices; + + /** + * Gets the ManufacturingDataServicesClient object to access its operations. + * + * @return the ManufacturingDataServicesClient object. + */ + public ManufacturingDataServicesClient getManufacturingDataServices() { + return this.manufacturingDataServices; + } + + /** + * Initializes an instance of MicrosoftManufacturingPlatform client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + MicrosoftManufacturingPlatformImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-02-01-preview"; + this.operations = new OperationsClientImpl(this); + this.manufacturingDataServices = new ManufacturingDataServicesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MicrosoftManufacturingPlatformImpl.class); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationImpl.java new file mode 100644 index 000000000000..0a48613f2789 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.manufacturingplatform.models.ActionType; +import com.azure.resourcemanager.manufacturingplatform.models.Operation; +import com.azure.resourcemanager.manufacturingplatform.models.OperationDisplay; +import com.azure.resourcemanager.manufacturingplatform.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsClientImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..b6849ade780c --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsClientImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.manufacturingplatform.fluent.OperationsClient; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.manufacturingplatform.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftManufacturingPlatformImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MicrosoftManufacturingPlatformImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftManufacturingPlatformOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftManufacturi") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ManufacturingPlatform/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ManufacturingPlatform/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsImpl.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsImpl.java new file mode 100644 index 000000000000..4401208ad6f1 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/OperationsImpl.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.manufacturingplatform.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.manufacturingplatform.fluent.OperationsClient; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.manufacturingplatform.models.Operation; +import com.azure.resourcemanager.manufacturingplatform.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ResourceManagerUtils.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..dec80c00781d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/package-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/package-info.java new file mode 100644 index 000000000000..c3ea8ff60539 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for MicrosoftManufacturingPlatform. + * null. + */ +package com.azure.resourcemanager.manufacturingplatform.implementation; diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ActionType.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ActionType.java new file mode 100644 index 000000000000..b26cadce93af --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ActionType.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.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AdxProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AdxProfile.java new file mode 100644 index 000000000000..3225d78bb763 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AdxProfile.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Azure Data Explorer (Adx) Resource. + */ +@Immutable +public final class AdxProfile implements JsonSerializable { + /* + * Resource Id of Adx Resource + */ + private String id; + + /* + * Uri of Adx Resource + */ + private String uri; + + /* + * Data Ingestion Uri of Adx Resource + */ + private String dataIngestionUri; + + /** + * Creates an instance of AdxProfile class. + */ + public AdxProfile() { + } + + /** + * Get the id property: Resource Id of Adx Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the uri property: Uri of Adx Resource. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: Data Ingestion Uri of Adx Resource. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdxProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdxProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AdxProfile. + */ + public static AdxProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdxProfile deserializedAdxProfile = new AdxProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAdxProfile.id = reader.getString(); + } else if ("uri".equals(fieldName)) { + deserializedAdxProfile.uri = reader.getString(); + } else if ("dataIngestionUri".equals(fieldName)) { + deserializedAdxProfile.dataIngestionUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdxProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AksProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AksProfile.java new file mode 100644 index 000000000000..75019dec67f3 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AksProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Aks Resource. + */ +@Immutable +public final class AksProfile implements JsonSerializable { + /* + * Resource Id of AKS Resource + */ + private String id; + + /** + * Creates an instance of AksProfile class. + */ + public AksProfile() { + } + + /** + * Get the id property: Resource Id of AKS Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AksProfile. + */ + public static AksProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksProfile deserializedAksProfile = new AksProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfile.java new file mode 100644 index 000000000000..db7dd982ad7d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfile.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Azure Machine Learning Resource. + */ +@Fluent +public final class AmlProfile implements JsonSerializable { + /* + * Resource Id of Azure Machine Learning Resource + */ + private String id; + + /* + * Custom Ner Service Uri + */ + private String customNerServiceUri; + + /** + * Creates an instance of AmlProfile class. + */ + public AmlProfile() { + } + + /** + * Get the id property: Resource Id of Azure Machine Learning Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of Azure Machine Learning Resource. + * + * @param id the id value to set. + * @return the AmlProfile object itself. + */ + public AmlProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the customNerServiceUri property: Custom Ner Service Uri. + * + * @return the customNerServiceUri value. + */ + public String customNerServiceUri() { + return this.customNerServiceUri; + } + + /** + * Set the customNerServiceUri property: Custom Ner Service Uri. + * + * @param customNerServiceUri the customNerServiceUri value to set. + * @return the AmlProfile object itself. + */ + public AmlProfile withCustomNerServiceUri(String customNerServiceUri) { + this.customNerServiceUri = customNerServiceUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model AmlProfile")); + } + if (customNerServiceUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property customNerServiceUri in model AmlProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AmlProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("customNerServiceUri", this.customNerServiceUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AmlProfile. + */ + public static AmlProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlProfile deserializedAmlProfile = new AmlProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAmlProfile.id = reader.getString(); + } else if ("customNerServiceUri".equals(fieldName)) { + deserializedAmlProfile.customNerServiceUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfileUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfileUpdate.java new file mode 100644 index 000000000000..38928d06b1d9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AmlProfileUpdate.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.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Azure Machine Learning Resource. + */ +@Fluent +public final class AmlProfileUpdate implements JsonSerializable { + /* + * Resource Id of Azure Machine Learning Resource + */ + private String id; + + /* + * Custom Ner Service Uri + */ + private String customNerServiceUri; + + /** + * Creates an instance of AmlProfileUpdate class. + */ + public AmlProfileUpdate() { + } + + /** + * Get the id property: Resource Id of Azure Machine Learning Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of Azure Machine Learning Resource. + * + * @param id the id value to set. + * @return the AmlProfileUpdate object itself. + */ + public AmlProfileUpdate withId(String id) { + this.id = id; + return this; + } + + /** + * Get the customNerServiceUri property: Custom Ner Service Uri. + * + * @return the customNerServiceUri value. + */ + public String customNerServiceUri() { + return this.customNerServiceUri; + } + + /** + * Set the customNerServiceUri property: Custom Ner Service Uri. + * + * @param customNerServiceUri the customNerServiceUri value to set. + * @return the AmlProfileUpdate object itself. + */ + public AmlProfileUpdate withCustomNerServiceUri(String customNerServiceUri) { + this.customNerServiceUri = customNerServiceUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("customNerServiceUri", this.customNerServiceUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlProfileUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlProfileUpdate. + */ + public static AmlProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlProfileUpdate deserializedAmlProfileUpdate = new AmlProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAmlProfileUpdate.id = reader.getString(); + } else if ("customNerServiceUri".equals(fieldName)) { + deserializedAmlProfileUpdate.customNerServiceUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlProfileUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ApplicationVersion.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ApplicationVersion.java new file mode 100644 index 000000000000..206de34a964d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ApplicationVersion.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about application versions. + */ +@Fluent +public final class ApplicationVersion implements JsonSerializable { + /* + * Application Version + */ + private String version; + + /* + * Is Latest + */ + private boolean isLatest; + + /* + * Is Preview + */ + private boolean isPreview; + + /* + * Is Deprecated + */ + private boolean isDeprecated; + + /** + * Creates an instance of ApplicationVersion class. + */ + public ApplicationVersion() { + } + + /** + * Get the version property: Application Version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Application Version. + * + * @param version the version value to set. + * @return the ApplicationVersion object itself. + */ + public ApplicationVersion withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the isLatest property: Is Latest. + * + * @return the isLatest value. + */ + public boolean isLatest() { + return this.isLatest; + } + + /** + * Set the isLatest property: Is Latest. + * + * @param isLatest the isLatest value to set. + * @return the ApplicationVersion object itself. + */ + public ApplicationVersion withIsLatest(boolean isLatest) { + this.isLatest = isLatest; + return this; + } + + /** + * Get the isPreview property: Is Preview. + * + * @return the isPreview value. + */ + public boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Is Preview. + * + * @param isPreview the isPreview value to set. + * @return the ApplicationVersion object itself. + */ + public ApplicationVersion withIsPreview(boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Get the isDeprecated property: Is Deprecated. + * + * @return the isDeprecated value. + */ + public boolean isDeprecated() { + return this.isDeprecated; + } + + /** + * Set the isDeprecated property: Is Deprecated. + * + * @param isDeprecated the isDeprecated value to set. + * @return the ApplicationVersion object itself. + */ + public ApplicationVersion withIsDeprecated(boolean isDeprecated) { + this.isDeprecated = isDeprecated; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property version in model ApplicationVersion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationVersion.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeBooleanField("isLatest", this.isLatest); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + jsonWriter.writeBooleanField("isDeprecated", this.isDeprecated); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationVersion. + */ + public static ApplicationVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationVersion deserializedApplicationVersion = new ApplicationVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedApplicationVersion.version = reader.getString(); + } else if ("isLatest".equals(fieldName)) { + deserializedApplicationVersion.isLatest = reader.getBoolean(); + } else if ("isPreview".equals(fieldName)) { + deserializedApplicationVersion.isPreview = reader.getBoolean(); + } else if ("isDeprecated".equals(fieldName)) { + deserializedApplicationVersion.isDeprecated = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationVersion; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AvailableVersionListResult.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AvailableVersionListResult.java new file mode 100644 index 000000000000..1be1b9cdfd1a --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AvailableVersionListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.resourcemanager.manufacturingplatform.fluent.models.AvailableVersionListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of AvailableVersionListResult. + */ +public interface AvailableVersionListResult { + /** + * Gets the versions property: The list of versions. + * + * @return the versions value. + */ + List versions(); + + /** + * Gets the inner com.azure.resourcemanager.manufacturingplatform.fluent.models.AvailableVersionListResultInner + * object. + * + * @return the inner object. + */ + AvailableVersionListResultInner innerModel(); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java new file mode 100644 index 000000000000..496f6feeee73 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class AzureResourceManagerCommonTypesManagedServiceIdentityUpdate + implements JsonSerializable { + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate class. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() { + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the AzureResourceManagerCommonTypesManagedServiceIdentityUpdate object itself. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the AzureResourceManagerCommonTypesManagedServiceIdentityUpdate object itself. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate + withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AzureResourceManagerCommonTypesManagedServiceIdentityUpdate. + */ + public static AzureResourceManagerCommonTypesManagedServiceIdentityUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerCommonTypesManagedServiceIdentityUpdate deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate + = new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate.type + = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate.userAssignedIdentities + = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesSkuUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesSkuUpdate.java new file mode 100644 index 000000000000..5323e4d55288 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/AzureResourceManagerCommonTypesSkuUpdate.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource model definition representing SKU. + */ +@Fluent +public final class AzureResourceManagerCommonTypesSkuUpdate + implements JsonSerializable { + /* + * The name of the SKU. Ex - P3. It is typically a letter+number code + */ + private String name; + + /* + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is + * not required on a PUT. + */ + private SkuTier tier; + + /* + * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone + * code. + */ + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, then that can be captured here. + */ + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible + * for the resource this may be omitted. + */ + private Integer capacity; + + /** + * Creates an instance of AzureResourceManagerCommonTypesSkuUpdate class. + */ + public AzureResourceManagerCommonTypesSkuUpdate() { + } + + /** + * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the AzureResourceManagerCommonTypesSkuUpdate object itself. + */ + public AzureResourceManagerCommonTypesSkuUpdate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the AzureResourceManagerCommonTypesSkuUpdate object itself. + */ + public AzureResourceManagerCommonTypesSkuUpdate withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the AzureResourceManagerCommonTypesSkuUpdate object itself. + */ + public AzureResourceManagerCommonTypesSkuUpdate withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the AzureResourceManagerCommonTypesSkuUpdate object itself. + */ + public AzureResourceManagerCommonTypesSkuUpdate withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the AzureResourceManagerCommonTypesSkuUpdate object itself. + */ + public AzureResourceManagerCommonTypesSkuUpdate withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeNumberField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerCommonTypesSkuUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerCommonTypesSkuUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureResourceManagerCommonTypesSkuUpdate. + */ + public static AzureResourceManagerCommonTypesSkuUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerCommonTypesSkuUpdate deserializedAzureResourceManagerCommonTypesSkuUpdate + = new AzureResourceManagerCommonTypesSkuUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesSkuUpdate.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesSkuUpdate.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesSkuUpdate.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesSkuUpdate.family = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesSkuUpdate.capacity + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerCommonTypesSkuUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/CmkProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/CmkProfile.java new file mode 100644 index 000000000000..41f6692a55e9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/CmkProfile.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to CMK. + */ +@Fluent +public final class CmkProfile implements JsonSerializable { + /* + * URI of Key in AKV + */ + private String keyUri; + + /** + * Creates an instance of CmkProfile class. + */ + public CmkProfile() { + } + + /** + * Get the keyUri property: URI of Key in AKV. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: URI of Key in AKV. + * + * @param keyUri the keyUri value to set. + * @return the CmkProfile object itself. + */ + public CmkProfile withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyUri in model CmkProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CmkProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUri", this.keyUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CmkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CmkProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CmkProfile. + */ + public static CmkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CmkProfile deserializedCmkProfile = new CmkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedCmkProfile.keyUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCmkProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DatabaseProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DatabaseProfile.java new file mode 100644 index 000000000000..3a3985b97b8a --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DatabaseProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Database Resource. + */ +@Immutable +public final class DatabaseProfile implements JsonSerializable { + /* + * Resource Id of Cosmos Resource + */ + private String cosmosId; + + /** + * Creates an instance of DatabaseProfile class. + */ + public DatabaseProfile() { + } + + /** + * Get the cosmosId property: Resource Id of Cosmos Resource. + * + * @return the cosmosId value. + */ + public String cosmosId() { + return this.cosmosId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseProfile. + */ + public static DatabaseProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseProfile deserializedDatabaseProfile = new DatabaseProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cosmosId".equals(fieldName)) { + deserializedDatabaseProfile.cosmosId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DenyAssignmentExclusion.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DenyAssignmentExclusion.java new file mode 100644 index 000000000000..5ac51521db6e --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/DenyAssignmentExclusion.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Deny Assignment Exclusions. + */ +@Fluent +public final class DenyAssignmentExclusion implements JsonSerializable { + /* + * Object Id of Identity + */ + private String id; + + /* + * Type of Identity + */ + private String type; + + /** + * Creates an instance of DenyAssignmentExclusion class. + */ + public DenyAssignmentExclusion() { + } + + /** + * Get the id property: Object Id of Identity. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Object Id of Identity. + * + * @param id the id value to set. + * @return the DenyAssignmentExclusion object itself. + */ + public DenyAssignmentExclusion withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Type of Identity. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of Identity. + * + * @param type the type value to set. + * @return the DenyAssignmentExclusion object itself. + */ + public DenyAssignmentExclusion withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model DenyAssignmentExclusion")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model DenyAssignmentExclusion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DenyAssignmentExclusion.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DenyAssignmentExclusion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DenyAssignmentExclusion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DenyAssignmentExclusion. + */ + public static DenyAssignmentExclusion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DenyAssignmentExclusion deserializedDenyAssignmentExclusion = new DenyAssignmentExclusion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDenyAssignmentExclusion.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDenyAssignmentExclusion.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDenyAssignmentExclusion; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/EventHubProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/EventHubProfile.java new file mode 100644 index 000000000000..751bc0d3451a --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/EventHubProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to EventHub Resource. + */ +@Immutable +public final class EventHubProfile implements JsonSerializable { + /* + * Resource Id of Adx Instance + */ + private String adxInstanceId; + + /* + * Host Name + */ + private String hostname; + + /** + * Creates an instance of EventHubProfile class. + */ + public EventHubProfile() { + } + + /** + * Get the adxInstanceId property: Resource Id of Adx Instance. + * + * @return the adxInstanceId value. + */ + public String adxInstanceId() { + return this.adxInstanceId; + } + + /** + * Get the hostname property: Host Name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventHubProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventHubProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EventHubProfile. + */ + public static EventHubProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventHubProfile deserializedEventHubProfile = new EventHubProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adxInstanceId".equals(fieldName)) { + deserializedEventHubProfile.adxInstanceId = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedEventHubProfile.hostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventHubProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfile.java new file mode 100644 index 000000000000..49f929a2c9da --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfile.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Fabric. + */ +@Fluent +public final class FabricProfile implements JsonSerializable { + /* + * Azure Key Vault Uri + */ + private String keyUri; + + /* + * URI of One Lake + */ + private String oneLakeUri; + + /* + * One Lake Path + */ + private String oneLakePath; + + /** + * Creates an instance of FabricProfile class. + */ + public FabricProfile() { + } + + /** + * Get the keyUri property: Azure Key Vault Uri. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: Azure Key Vault Uri. + * + * @param keyUri the keyUri value to set. + * @return the FabricProfile object itself. + */ + public FabricProfile withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Get the oneLakeUri property: URI of One Lake. + * + * @return the oneLakeUri value. + */ + public String oneLakeUri() { + return this.oneLakeUri; + } + + /** + * Set the oneLakeUri property: URI of One Lake. + * + * @param oneLakeUri the oneLakeUri value to set. + * @return the FabricProfile object itself. + */ + public FabricProfile withOneLakeUri(String oneLakeUri) { + this.oneLakeUri = oneLakeUri; + return this; + } + + /** + * Get the oneLakePath property: One Lake Path. + * + * @return the oneLakePath value. + */ + public String oneLakePath() { + return this.oneLakePath; + } + + /** + * Set the oneLakePath property: One Lake Path. + * + * @param oneLakePath the oneLakePath value to set. + * @return the FabricProfile object itself. + */ + public FabricProfile withOneLakePath(String oneLakePath) { + this.oneLakePath = oneLakePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyUri in model FabricProfile")); + } + if (oneLakeUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property oneLakeUri in model FabricProfile")); + } + if (oneLakePath() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property oneLakePath in model FabricProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FabricProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUri", this.keyUri); + jsonWriter.writeStringField("oneLakeUri", this.oneLakeUri); + jsonWriter.writeStringField("oneLakePath", this.oneLakePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricProfile. + */ + public static FabricProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FabricProfile deserializedFabricProfile = new FabricProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedFabricProfile.keyUri = reader.getString(); + } else if ("oneLakeUri".equals(fieldName)) { + deserializedFabricProfile.oneLakeUri = reader.getString(); + } else if ("oneLakePath".equals(fieldName)) { + deserializedFabricProfile.oneLakePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFabricProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfileUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfileUpdate.java new file mode 100644 index 000000000000..b44f1975cab7 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FabricProfileUpdate.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Fabric. + */ +@Fluent +public final class FabricProfileUpdate implements JsonSerializable { + /* + * Azure Key Vault Uri + */ + private String keyUri; + + /* + * URI of One Lake + */ + private String oneLakeUri; + + /* + * One Lake Path + */ + private String oneLakePath; + + /** + * Creates an instance of FabricProfileUpdate class. + */ + public FabricProfileUpdate() { + } + + /** + * Get the keyUri property: Azure Key Vault Uri. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: Azure Key Vault Uri. + * + * @param keyUri the keyUri value to set. + * @return the FabricProfileUpdate object itself. + */ + public FabricProfileUpdate withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Get the oneLakeUri property: URI of One Lake. + * + * @return the oneLakeUri value. + */ + public String oneLakeUri() { + return this.oneLakeUri; + } + + /** + * Set the oneLakeUri property: URI of One Lake. + * + * @param oneLakeUri the oneLakeUri value to set. + * @return the FabricProfileUpdate object itself. + */ + public FabricProfileUpdate withOneLakeUri(String oneLakeUri) { + this.oneLakeUri = oneLakeUri; + return this; + } + + /** + * Get the oneLakePath property: One Lake Path. + * + * @return the oneLakePath value. + */ + public String oneLakePath() { + return this.oneLakePath; + } + + /** + * Set the oneLakePath property: One Lake Path. + * + * @param oneLakePath the oneLakePath value to set. + * @return the FabricProfileUpdate object itself. + */ + public FabricProfileUpdate withOneLakePath(String oneLakePath) { + this.oneLakePath = oneLakePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUri", this.keyUri); + jsonWriter.writeStringField("oneLakeUri", this.oneLakeUri); + jsonWriter.writeStringField("oneLakePath", this.oneLakePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricProfileUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FabricProfileUpdate. + */ + public static FabricProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FabricProfileUpdate deserializedFabricProfileUpdate = new FabricProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedFabricProfileUpdate.keyUri = reader.getString(); + } else if ("oneLakeUri".equals(fieldName)) { + deserializedFabricProfileUpdate.oneLakeUri = reader.getString(); + } else if ("oneLakePath".equals(fieldName)) { + deserializedFabricProfileUpdate.oneLakePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFabricProfileUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FunctionAppProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FunctionAppProfile.java new file mode 100644 index 000000000000..22794d575646 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/FunctionAppProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Azure Function App Resource. + */ +@Immutable +public final class FunctionAppProfile implements JsonSerializable { + /* + * Resource Id of Azure Function App Resource + */ + private String id; + + /** + * Creates an instance of FunctionAppProfile class. + */ + public FunctionAppProfile() { + } + + /** + * Get the id property: Resource Id of Azure Function App Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionAppProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionAppProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FunctionAppProfile. + */ + public static FunctionAppProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FunctionAppProfile deserializedFunctionAppProfile = new FunctionAppProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFunctionAppProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFunctionAppProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedOnBehalfOfConfiguration.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedOnBehalfOfConfiguration.java new file mode 100644 index 000000000000..f066768f7af9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedOnBehalfOfConfiguration.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of the managed on behalf of resource. + */ +@Immutable +public final class ManagedOnBehalfOfConfiguration implements JsonSerializable { + /* + * Associated MoboBrokerResources. + */ + private List moboBrokerResources; + + /** + * Creates an instance of ManagedOnBehalfOfConfiguration class. + */ + public ManagedOnBehalfOfConfiguration() { + } + + /** + * Get the moboBrokerResources property: Associated MoboBrokerResources. + * + * @return the moboBrokerResources value. + */ + public List moboBrokerResources() { + return this.moboBrokerResources; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moboBrokerResources() != null) { + moboBrokerResources().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedOnBehalfOfConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedOnBehalfOfConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedOnBehalfOfConfiguration. + */ + public static ManagedOnBehalfOfConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedOnBehalfOfConfiguration deserializedManagedOnBehalfOfConfiguration + = new ManagedOnBehalfOfConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("moboBrokerResources".equals(fieldName)) { + List moboBrokerResources + = reader.readArray(reader1 -> MoboBrokerResource.fromJson(reader1)); + deserializedManagedOnBehalfOfConfiguration.moboBrokerResources = moboBrokerResources; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedOnBehalfOfConfiguration; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedResourceGroupConfiguration.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..04ef51bec475 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedResourceGroupConfiguration.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of the managed resource group associated with the resource. + */ +@Fluent +public final class ManagedResourceGroupConfiguration implements JsonSerializable { + /* + * The resource group name. + */ + private String name; + + /* + * The resource group location. + */ + private String location; + + /** + * Creates an instance of ManagedResourceGroupConfiguration class. + */ + public ManagedResourceGroupConfiguration() { + } + + /** + * Get the name property: The resource group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource group name. + * + * @param name the name value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: The resource group location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The resource group location. + * + * @param location the location value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ManagedResourceGroupConfiguration")); + } + if (location() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model ManagedResourceGroupConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedResourceGroupConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedResourceGroupConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedResourceGroupConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedResourceGroupConfiguration. + */ + public static ManagedResourceGroupConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedResourceGroupConfiguration deserializedManagedResourceGroupConfiguration + = new ManagedResourceGroupConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.name = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedResourceGroupConfiguration; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentity.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..5a3393660ea4 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentity.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.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentityType.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..44a10249affd --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManufacturingDataServices.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManufacturingDataServices.java new file mode 100644 index 000000000000..762ee23880d9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ManufacturingDataServices.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.manufacturingplatform.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 ManufacturingDataServices. + */ +public interface ManufacturingDataServices { + /** + * List MdsResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException 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 of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List MdsResource resources by subscription 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 response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List MdsResource resources by resource group. + * + * @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 the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MdsResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MdsResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MdsResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String mdsResourceName, + Context context); + + /** + * Get a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 MdsResource. + */ + MdsResource getByResourceGroup(String resourceGroupName, String mdsResourceName); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 deleteByResourceGroup(String resourceGroupName, String mdsResourceName); + + /** + * Delete a MdsResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 mdsResourceName, Context context); + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions along with {@link Response}. + */ + Response listAvailableVersionsWithResponse(String resourceGroupName, + String mdsResourceName, Context context); + + /** + * Returns the list of available versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mdsResourceName 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 list of available versions. + */ + AvailableVersionListResult listAvailableVersions(String resourceGroupName, String mdsResourceName); + + /** + * Get a MdsResource. + * + * @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 MdsResource along with {@link Response}. + */ + MdsResource getById(String id); + + /** + * Get a MdsResource. + * + * @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 a MdsResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a MdsResource. + * + * @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 MdsResource. + * + * @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 MdsResource resource. + * + * @param name resource name. + * @return the first stage of the new MdsResource definition. + */ + MdsResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResource.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResource.java new file mode 100644 index 000000000000..3180e4915ab3 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResource.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of MdsResource. + */ +public interface MdsResource { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + MdsResourceProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @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.manufacturingplatform.fluent.models.MdsResourceInner object. + * + * @return the inner object. + */ + MdsResourceInner innerModel(); + + /** + * The entirety of the MdsResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The MdsResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MdsResource definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the MdsResource 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 MdsResource definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the MdsResource 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.WithProperties, + DefinitionStages.WithIdentity, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + MdsResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MdsResource create(Context context); + } + + /** + * The stage of the MdsResource 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 MdsResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(MdsResourceProperties properties); + } + + /** + * The stage of the MdsResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the MdsResource definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. + * + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the MdsResource resource. + * + * @return the stage of resource update. + */ + MdsResource.Update update(); + + /** + * The template for MdsResource update. + */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MdsResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MdsResource apply(Context context); + } + + /** + * The MdsResource update stages. + */ + interface UpdateStages { + /** + * The stage of the MdsResource 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 MdsResource update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity); + } + + /** + * The stage of the MdsResource update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. + * + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. + * @return the next definition stage. + */ + Update withSku(AzureResourceManagerCommonTypesSkuUpdate sku); + } + + /** + * The stage of the MdsResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(MdsResourceUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MdsResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MdsResource refresh(Context context); + + /** + * Returns the list of available versions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available versions along with {@link Response}. + */ + Response listAvailableVersionsWithResponse(Context context); + + /** + * Returns the list of available versions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available versions. + */ + AvailableVersionListResult listAvailableVersions(); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceListResult.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceListResult.java new file mode 100644 index 000000000000..615fe8cff292 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.MdsResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MdsResource list operation. + */ +@Fluent +public final class MdsResourceListResult implements JsonSerializable { + /* + * The MdsResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MdsResourceListResult class. + */ + public MdsResourceListResult() { + } + + /** + * Get the value property: The MdsResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The MdsResource items on this page. + * + * @param value the value value to set. + * @return the MdsResourceListResult object itself. + */ + public MdsResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MdsResourceListResult object itself. + */ + public MdsResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model MdsResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MdsResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MdsResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MdsResourceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MdsResourceListResult. + */ + public static MdsResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MdsResourceListResult deserializedMdsResourceListResult = new MdsResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MdsResourceInner.fromJson(reader1)); + deserializedMdsResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMdsResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMdsResourceListResult; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceProperties.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceProperties.java new file mode 100644 index 000000000000..f75aac11d052 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceProperties.java @@ -0,0 +1,809 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of the ManufacturingPlatform MdsResource. + */ +@Fluent +public final class MdsResourceProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Mds Resource Version. + */ + private String version; + + /* + * Enable Teams Notification. + */ + private Boolean enableTeamsNotification; + + /* + * Enable Copilot. + */ + private Boolean enableCopilot; + + /* + * Enable Diagnostic Settings. + */ + private Boolean enableDiagnosticSettings; + + /* + * AAD Application Id. + */ + private String aadApplicationId; + + /* + * AKS Admin Group Id. + */ + private String aksAdminGroupId; + + /* + * Continuous Export Period. + */ + private Integer continuousExportPeriod; + + /* + * Service Url + */ + private String serviceUrl; + + /* + * Profile of AKS Created. + */ + private AksProfile aksProfile; + + /* + * Profile of Storage Created. + */ + private StorageProfile storageProfile; + + /* + * Profile of Database Created. + */ + private DatabaseProfile databaseProfile; + + /* + * Profile of Adx Created. + */ + private AdxProfile adxProfile; + + /* + * Profile of Azure Redis Created. + */ + private RedisProfile redisProfile; + + /* + * Profile of Monitoring Resource Created. + */ + private MonitoringProfile monitoringProfile; + + /* + * Profile of EventHub Resource. + */ + private EventHubProfile eventHubProfile; + + /* + * Profile of Function App Resource. + */ + private FunctionAppProfile functionAppProfile; + + /* + * Profile of OpenAI Resource. + */ + private OpenAIProfile openAIProfile; + + /* + * Configuration of the managed resource group associated with the resource. + */ + private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * Managed On Behalf Of Configuration. + */ + private ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration; + + /* + * Profile of Azure Machine Learning Resource. + */ + private AmlProfile amlProfile; + + /* + * Profile of User Managed Database. + */ + private UserManagedDatabaseProfile userManagedDatabaseProfile; + + /* + * Profile of User Managed Adx. + */ + private UserManagedAdxProfile userManagedAdxProfile; + + /* + * Profile of CMK Settings. + */ + private CmkProfile cmkProfile; + + /* + * Profile of Fabric resources. + */ + private FabricProfile fabricProfile; + + /* + * Profile of User Managed OpenAI Resource. + */ + private UserManagedOpenAIProfile userManagedOpenAIProfile; + + /* + * Deny Assignments exclusion list. + */ + private List denyAssignmentExclusions; + + /* + * State of the resource + */ + private ResourceState resourceState; + + /* + * Zone redundancy state for resources + */ + private RedundancyState redundancyState; + + /** + * Creates an instance of MdsResourceProperties class. + */ + public MdsResourceProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the version property: Mds Resource Version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Mds Resource Version. + * + * @param version the version value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the enableTeamsNotification property: Enable Teams Notification. + * + * @return the enableTeamsNotification value. + */ + public Boolean enableTeamsNotification() { + return this.enableTeamsNotification; + } + + /** + * Set the enableTeamsNotification property: Enable Teams Notification. + * + * @param enableTeamsNotification the enableTeamsNotification value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withEnableTeamsNotification(Boolean enableTeamsNotification) { + this.enableTeamsNotification = enableTeamsNotification; + return this; + } + + /** + * Get the enableCopilot property: Enable Copilot. + * + * @return the enableCopilot value. + */ + public Boolean enableCopilot() { + return this.enableCopilot; + } + + /** + * Set the enableCopilot property: Enable Copilot. + * + * @param enableCopilot the enableCopilot value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withEnableCopilot(Boolean enableCopilot) { + this.enableCopilot = enableCopilot; + return this; + } + + /** + * Get the enableDiagnosticSettings property: Enable Diagnostic Settings. + * + * @return the enableDiagnosticSettings value. + */ + public Boolean enableDiagnosticSettings() { + return this.enableDiagnosticSettings; + } + + /** + * Set the enableDiagnosticSettings property: Enable Diagnostic Settings. + * + * @param enableDiagnosticSettings the enableDiagnosticSettings value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withEnableDiagnosticSettings(Boolean enableDiagnosticSettings) { + this.enableDiagnosticSettings = enableDiagnosticSettings; + return this; + } + + /** + * Get the aadApplicationId property: AAD Application Id. + * + * @return the aadApplicationId value. + */ + public String aadApplicationId() { + return this.aadApplicationId; + } + + /** + * Set the aadApplicationId property: AAD Application Id. + * + * @param aadApplicationId the aadApplicationId value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withAadApplicationId(String aadApplicationId) { + this.aadApplicationId = aadApplicationId; + return this; + } + + /** + * Get the aksAdminGroupId property: AKS Admin Group Id. + * + * @return the aksAdminGroupId value. + */ + public String aksAdminGroupId() { + return this.aksAdminGroupId; + } + + /** + * Set the aksAdminGroupId property: AKS Admin Group Id. + * + * @param aksAdminGroupId the aksAdminGroupId value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withAksAdminGroupId(String aksAdminGroupId) { + this.aksAdminGroupId = aksAdminGroupId; + return this; + } + + /** + * Get the continuousExportPeriod property: Continuous Export Period. + * + * @return the continuousExportPeriod value. + */ + public Integer continuousExportPeriod() { + return this.continuousExportPeriod; + } + + /** + * Set the continuousExportPeriod property: Continuous Export Period. + * + * @param continuousExportPeriod the continuousExportPeriod value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withContinuousExportPeriod(Integer continuousExportPeriod) { + this.continuousExportPeriod = continuousExportPeriod; + return this; + } + + /** + * Get the serviceUrl property: Service Url. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Get the aksProfile property: Profile of AKS Created. + * + * @return the aksProfile value. + */ + public AksProfile aksProfile() { + return this.aksProfile; + } + + /** + * Get the storageProfile property: Profile of Storage Created. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Get the databaseProfile property: Profile of Database Created. + * + * @return the databaseProfile value. + */ + public DatabaseProfile databaseProfile() { + return this.databaseProfile; + } + + /** + * Get the adxProfile property: Profile of Adx Created. + * + * @return the adxProfile value. + */ + public AdxProfile adxProfile() { + return this.adxProfile; + } + + /** + * Get the redisProfile property: Profile of Azure Redis Created. + * + * @return the redisProfile value. + */ + public RedisProfile redisProfile() { + return this.redisProfile; + } + + /** + * Get the monitoringProfile property: Profile of Monitoring Resource Created. + * + * @return the monitoringProfile value. + */ + public MonitoringProfile monitoringProfile() { + return this.monitoringProfile; + } + + /** + * Get the eventHubProfile property: Profile of EventHub Resource. + * + * @return the eventHubProfile value. + */ + public EventHubProfile eventHubProfile() { + return this.eventHubProfile; + } + + /** + * Get the functionAppProfile property: Profile of Function App Resource. + * + * @return the functionAppProfile value. + */ + public FunctionAppProfile functionAppProfile() { + return this.functionAppProfile; + } + + /** + * Get the openAIProfile property: Profile of OpenAI Resource. + * + * @return the openAIProfile value. + */ + public OpenAIProfile openAIProfile() { + return this.openAIProfile; + } + + /** + * Set the openAIProfile property: Profile of OpenAI Resource. + * + * @param openAIProfile the openAIProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withOpenAIProfile(OpenAIProfile openAIProfile) { + this.openAIProfile = openAIProfile; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Configuration of the managed resource group associated with + * the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Get the managedOnBehalfOfConfiguration property: Managed On Behalf Of Configuration. + * + * @return the managedOnBehalfOfConfiguration value. + */ + public ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration() { + return this.managedOnBehalfOfConfiguration; + } + + /** + * Get the amlProfile property: Profile of Azure Machine Learning Resource. + * + * @return the amlProfile value. + */ + public AmlProfile amlProfile() { + return this.amlProfile; + } + + /** + * Set the amlProfile property: Profile of Azure Machine Learning Resource. + * + * @param amlProfile the amlProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withAmlProfile(AmlProfile amlProfile) { + this.amlProfile = amlProfile; + return this; + } + + /** + * Get the userManagedDatabaseProfile property: Profile of User Managed Database. + * + * @return the userManagedDatabaseProfile value. + */ + public UserManagedDatabaseProfile userManagedDatabaseProfile() { + return this.userManagedDatabaseProfile; + } + + /** + * Set the userManagedDatabaseProfile property: Profile of User Managed Database. + * + * @param userManagedDatabaseProfile the userManagedDatabaseProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withUserManagedDatabaseProfile(UserManagedDatabaseProfile userManagedDatabaseProfile) { + this.userManagedDatabaseProfile = userManagedDatabaseProfile; + return this; + } + + /** + * Get the userManagedAdxProfile property: Profile of User Managed Adx. + * + * @return the userManagedAdxProfile value. + */ + public UserManagedAdxProfile userManagedAdxProfile() { + return this.userManagedAdxProfile; + } + + /** + * Set the userManagedAdxProfile property: Profile of User Managed Adx. + * + * @param userManagedAdxProfile the userManagedAdxProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withUserManagedAdxProfile(UserManagedAdxProfile userManagedAdxProfile) { + this.userManagedAdxProfile = userManagedAdxProfile; + return this; + } + + /** + * Get the cmkProfile property: Profile of CMK Settings. + * + * @return the cmkProfile value. + */ + public CmkProfile cmkProfile() { + return this.cmkProfile; + } + + /** + * Set the cmkProfile property: Profile of CMK Settings. + * + * @param cmkProfile the cmkProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withCmkProfile(CmkProfile cmkProfile) { + this.cmkProfile = cmkProfile; + return this; + } + + /** + * Get the fabricProfile property: Profile of Fabric resources. + * + * @return the fabricProfile value. + */ + public FabricProfile fabricProfile() { + return this.fabricProfile; + } + + /** + * Set the fabricProfile property: Profile of Fabric resources. + * + * @param fabricProfile the fabricProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withFabricProfile(FabricProfile fabricProfile) { + this.fabricProfile = fabricProfile; + return this; + } + + /** + * Get the userManagedOpenAIProfile property: Profile of User Managed OpenAI Resource. + * + * @return the userManagedOpenAIProfile value. + */ + public UserManagedOpenAIProfile userManagedOpenAIProfile() { + return this.userManagedOpenAIProfile; + } + + /** + * Set the userManagedOpenAIProfile property: Profile of User Managed OpenAI Resource. + * + * @param userManagedOpenAIProfile the userManagedOpenAIProfile value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withUserManagedOpenAIProfile(UserManagedOpenAIProfile userManagedOpenAIProfile) { + this.userManagedOpenAIProfile = userManagedOpenAIProfile; + return this; + } + + /** + * Get the denyAssignmentExclusions property: Deny Assignments exclusion list. + * + * @return the denyAssignmentExclusions value. + */ + public List denyAssignmentExclusions() { + return this.denyAssignmentExclusions; + } + + /** + * Set the denyAssignmentExclusions property: Deny Assignments exclusion list. + * + * @param denyAssignmentExclusions the denyAssignmentExclusions value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withDenyAssignmentExclusions(List denyAssignmentExclusions) { + this.denyAssignmentExclusions = denyAssignmentExclusions; + return this; + } + + /** + * Get the resourceState property: State of the resource. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Set the resourceState property: State of the resource. + * + * @param resourceState the resourceState value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withResourceState(ResourceState resourceState) { + this.resourceState = resourceState; + return this; + } + + /** + * Get the redundancyState property: Zone redundancy state for resources. + * + * @return the redundancyState value. + */ + public RedundancyState redundancyState() { + return this.redundancyState; + } + + /** + * Set the redundancyState property: Zone redundancy state for resources. + * + * @param redundancyState the redundancyState value to set. + * @return the MdsResourceProperties object itself. + */ + public MdsResourceProperties withRedundancyState(RedundancyState redundancyState) { + this.redundancyState = redundancyState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aadApplicationId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property aadApplicationId in model MdsResourceProperties")); + } + if (aksProfile() != null) { + aksProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (databaseProfile() != null) { + databaseProfile().validate(); + } + if (adxProfile() != null) { + adxProfile().validate(); + } + if (redisProfile() != null) { + redisProfile().validate(); + } + if (monitoringProfile() != null) { + monitoringProfile().validate(); + } + if (eventHubProfile() != null) { + eventHubProfile().validate(); + } + if (functionAppProfile() != null) { + functionAppProfile().validate(); + } + if (openAIProfile() != null) { + openAIProfile().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (managedOnBehalfOfConfiguration() != null) { + managedOnBehalfOfConfiguration().validate(); + } + if (amlProfile() != null) { + amlProfile().validate(); + } + if (userManagedDatabaseProfile() != null) { + userManagedDatabaseProfile().validate(); + } + if (userManagedAdxProfile() != null) { + userManagedAdxProfile().validate(); + } + if (cmkProfile() != null) { + cmkProfile().validate(); + } + if (fabricProfile() != null) { + fabricProfile().validate(); + } + if (userManagedOpenAIProfile() != null) { + userManagedOpenAIProfile().validate(); + } + if (denyAssignmentExclusions() != null) { + denyAssignmentExclusions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MdsResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aadApplicationId", this.aadApplicationId); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeBooleanField("enableTeamsNotification", this.enableTeamsNotification); + jsonWriter.writeBooleanField("enableCopilot", this.enableCopilot); + jsonWriter.writeBooleanField("enableDiagnosticSettings", this.enableDiagnosticSettings); + jsonWriter.writeStringField("aksAdminGroupId", this.aksAdminGroupId); + jsonWriter.writeNumberField("continuousExportPeriod", this.continuousExportPeriod); + jsonWriter.writeJsonField("openAIProfile", this.openAIProfile); + jsonWriter.writeJsonField("amlProfile", this.amlProfile); + jsonWriter.writeJsonField("userManagedDatabaseProfile", this.userManagedDatabaseProfile); + jsonWriter.writeJsonField("userManagedAdxProfile", this.userManagedAdxProfile); + jsonWriter.writeJsonField("cmkProfile", this.cmkProfile); + jsonWriter.writeJsonField("fabricProfile", this.fabricProfile); + jsonWriter.writeJsonField("userManagedOpenAIProfile", this.userManagedOpenAIProfile); + jsonWriter.writeArrayField("denyAssignmentExclusions", this.denyAssignmentExclusions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceState", this.resourceState == null ? null : this.resourceState.toString()); + jsonWriter.writeStringField("redundancyState", + this.redundancyState == null ? null : this.redundancyState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MdsResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MdsResourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MdsResourceProperties. + */ + public static MdsResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MdsResourceProperties deserializedMdsResourceProperties = new MdsResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aadApplicationId".equals(fieldName)) { + deserializedMdsResourceProperties.aadApplicationId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedMdsResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMdsResourceProperties.version = reader.getString(); + } else if ("enableTeamsNotification".equals(fieldName)) { + deserializedMdsResourceProperties.enableTeamsNotification + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableCopilot".equals(fieldName)) { + deserializedMdsResourceProperties.enableCopilot = reader.getNullable(JsonReader::getBoolean); + } else if ("enableDiagnosticSettings".equals(fieldName)) { + deserializedMdsResourceProperties.enableDiagnosticSettings + = reader.getNullable(JsonReader::getBoolean); + } else if ("aksAdminGroupId".equals(fieldName)) { + deserializedMdsResourceProperties.aksAdminGroupId = reader.getString(); + } else if ("continuousExportPeriod".equals(fieldName)) { + deserializedMdsResourceProperties.continuousExportPeriod = reader.getNullable(JsonReader::getInt); + } else if ("serviceUrl".equals(fieldName)) { + deserializedMdsResourceProperties.serviceUrl = reader.getString(); + } else if ("aksProfile".equals(fieldName)) { + deserializedMdsResourceProperties.aksProfile = AksProfile.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedMdsResourceProperties.storageProfile = StorageProfile.fromJson(reader); + } else if ("databaseProfile".equals(fieldName)) { + deserializedMdsResourceProperties.databaseProfile = DatabaseProfile.fromJson(reader); + } else if ("adxProfile".equals(fieldName)) { + deserializedMdsResourceProperties.adxProfile = AdxProfile.fromJson(reader); + } else if ("redisProfile".equals(fieldName)) { + deserializedMdsResourceProperties.redisProfile = RedisProfile.fromJson(reader); + } else if ("monitoringProfile".equals(fieldName)) { + deserializedMdsResourceProperties.monitoringProfile = MonitoringProfile.fromJson(reader); + } else if ("eventHubProfile".equals(fieldName)) { + deserializedMdsResourceProperties.eventHubProfile = EventHubProfile.fromJson(reader); + } else if ("functionAppProfile".equals(fieldName)) { + deserializedMdsResourceProperties.functionAppProfile = FunctionAppProfile.fromJson(reader); + } else if ("openAIProfile".equals(fieldName)) { + deserializedMdsResourceProperties.openAIProfile = OpenAIProfile.fromJson(reader); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedMdsResourceProperties.managedResourceGroupConfiguration + = ManagedResourceGroupConfiguration.fromJson(reader); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedMdsResourceProperties.managedOnBehalfOfConfiguration + = ManagedOnBehalfOfConfiguration.fromJson(reader); + } else if ("amlProfile".equals(fieldName)) { + deserializedMdsResourceProperties.amlProfile = AmlProfile.fromJson(reader); + } else if ("userManagedDatabaseProfile".equals(fieldName)) { + deserializedMdsResourceProperties.userManagedDatabaseProfile + = UserManagedDatabaseProfile.fromJson(reader); + } else if ("userManagedAdxProfile".equals(fieldName)) { + deserializedMdsResourceProperties.userManagedAdxProfile = UserManagedAdxProfile.fromJson(reader); + } else if ("cmkProfile".equals(fieldName)) { + deserializedMdsResourceProperties.cmkProfile = CmkProfile.fromJson(reader); + } else if ("fabricProfile".equals(fieldName)) { + deserializedMdsResourceProperties.fabricProfile = FabricProfile.fromJson(reader); + } else if ("userManagedOpenAIProfile".equals(fieldName)) { + deserializedMdsResourceProperties.userManagedOpenAIProfile + = UserManagedOpenAIProfile.fromJson(reader); + } else if ("denyAssignmentExclusions".equals(fieldName)) { + List denyAssignmentExclusions + = reader.readArray(reader1 -> DenyAssignmentExclusion.fromJson(reader1)); + deserializedMdsResourceProperties.denyAssignmentExclusions = denyAssignmentExclusions; + } else if ("resourceState".equals(fieldName)) { + deserializedMdsResourceProperties.resourceState = ResourceState.fromString(reader.getString()); + } else if ("redundancyState".equals(fieldName)) { + deserializedMdsResourceProperties.redundancyState = RedundancyState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMdsResourceProperties; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdate.java new file mode 100644 index 000000000000..c7da934786bb --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdate.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the MdsResource. + */ +@Fluent +public final class MdsResourceUpdate implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private AzureResourceManagerCommonTypesSkuUpdate sku; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties for this resource. + */ + private MdsResourceUpdateProperties properties; + + /** + * Creates an instance of MdsResourceUpdate class. + */ + public MdsResourceUpdate() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the MdsResourceUpdate object itself. + */ + public MdsResourceUpdate withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. + */ + public AzureResourceManagerCommonTypesSkuUpdate sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @param sku the sku value to set. + * @return the MdsResourceUpdate object itself. + */ + public MdsResourceUpdate withSku(AzureResourceManagerCommonTypesSkuUpdate 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 MdsResourceUpdate object itself. + */ + public MdsResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MdsResourceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MdsResourceUpdate object itself. + */ + public MdsResourceUpdate withProperties(MdsResourceUpdateProperties properties) { + this.properties = properties; + 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(); + } + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MdsResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MdsResourceUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MdsResourceUpdate. + */ + public static MdsResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MdsResourceUpdate deserializedMdsResourceUpdate = new MdsResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedMdsResourceUpdate.identity + = AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedMdsResourceUpdate.sku = AzureResourceManagerCommonTypesSkuUpdate.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMdsResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedMdsResourceUpdate.properties = MdsResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMdsResourceUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdateProperties.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdateProperties.java new file mode 100644 index 000000000000..68514f7cc16a --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MdsResourceUpdateProperties.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The updatable properties of the MdsResource. + */ +@Fluent +public final class MdsResourceUpdateProperties implements JsonSerializable { + /* + * Mds Resource Version. + */ + private String version; + + /* + * Enable Teams Notification. + */ + private Boolean enableTeamsNotification; + + /* + * Enable Copilot. + */ + private Boolean enableCopilot; + + /* + * Enable Diagnostic Settings. + */ + private Boolean enableDiagnosticSettings; + + /* + * Profile of OpenAI Resource. + */ + private OpenAIProfile openAIProfile; + + /* + * Profile of Azure Machine Learning Resource. + */ + private AmlProfileUpdate amlProfile; + + /* + * Profile of Fabric resources. + */ + private FabricProfileUpdate fabricProfile; + + /* + * Profile of User Managed OpenAI Resource. + */ + private UserManagedOpenAIProfileUpdate userManagedOpenAIProfile; + + /* + * Deny Assignments exclusion list. + */ + private List denyAssignmentExclusions; + + /* + * State of the resource + */ + private ResourceState resourceState; + + /** + * Creates an instance of MdsResourceUpdateProperties class. + */ + public MdsResourceUpdateProperties() { + } + + /** + * Get the version property: Mds Resource Version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Mds Resource Version. + * + * @param version the version value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the enableTeamsNotification property: Enable Teams Notification. + * + * @return the enableTeamsNotification value. + */ + public Boolean enableTeamsNotification() { + return this.enableTeamsNotification; + } + + /** + * Set the enableTeamsNotification property: Enable Teams Notification. + * + * @param enableTeamsNotification the enableTeamsNotification value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withEnableTeamsNotification(Boolean enableTeamsNotification) { + this.enableTeamsNotification = enableTeamsNotification; + return this; + } + + /** + * Get the enableCopilot property: Enable Copilot. + * + * @return the enableCopilot value. + */ + public Boolean enableCopilot() { + return this.enableCopilot; + } + + /** + * Set the enableCopilot property: Enable Copilot. + * + * @param enableCopilot the enableCopilot value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withEnableCopilot(Boolean enableCopilot) { + this.enableCopilot = enableCopilot; + return this; + } + + /** + * Get the enableDiagnosticSettings property: Enable Diagnostic Settings. + * + * @return the enableDiagnosticSettings value. + */ + public Boolean enableDiagnosticSettings() { + return this.enableDiagnosticSettings; + } + + /** + * Set the enableDiagnosticSettings property: Enable Diagnostic Settings. + * + * @param enableDiagnosticSettings the enableDiagnosticSettings value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withEnableDiagnosticSettings(Boolean enableDiagnosticSettings) { + this.enableDiagnosticSettings = enableDiagnosticSettings; + return this; + } + + /** + * Get the openAIProfile property: Profile of OpenAI Resource. + * + * @return the openAIProfile value. + */ + public OpenAIProfile openAIProfile() { + return this.openAIProfile; + } + + /** + * Set the openAIProfile property: Profile of OpenAI Resource. + * + * @param openAIProfile the openAIProfile value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withOpenAIProfile(OpenAIProfile openAIProfile) { + this.openAIProfile = openAIProfile; + return this; + } + + /** + * Get the amlProfile property: Profile of Azure Machine Learning Resource. + * + * @return the amlProfile value. + */ + public AmlProfileUpdate amlProfile() { + return this.amlProfile; + } + + /** + * Set the amlProfile property: Profile of Azure Machine Learning Resource. + * + * @param amlProfile the amlProfile value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withAmlProfile(AmlProfileUpdate amlProfile) { + this.amlProfile = amlProfile; + return this; + } + + /** + * Get the fabricProfile property: Profile of Fabric resources. + * + * @return the fabricProfile value. + */ + public FabricProfileUpdate fabricProfile() { + return this.fabricProfile; + } + + /** + * Set the fabricProfile property: Profile of Fabric resources. + * + * @param fabricProfile the fabricProfile value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withFabricProfile(FabricProfileUpdate fabricProfile) { + this.fabricProfile = fabricProfile; + return this; + } + + /** + * Get the userManagedOpenAIProfile property: Profile of User Managed OpenAI Resource. + * + * @return the userManagedOpenAIProfile value. + */ + public UserManagedOpenAIProfileUpdate userManagedOpenAIProfile() { + return this.userManagedOpenAIProfile; + } + + /** + * Set the userManagedOpenAIProfile property: Profile of User Managed OpenAI Resource. + * + * @param userManagedOpenAIProfile the userManagedOpenAIProfile value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties + withUserManagedOpenAIProfile(UserManagedOpenAIProfileUpdate userManagedOpenAIProfile) { + this.userManagedOpenAIProfile = userManagedOpenAIProfile; + return this; + } + + /** + * Get the denyAssignmentExclusions property: Deny Assignments exclusion list. + * + * @return the denyAssignmentExclusions value. + */ + public List denyAssignmentExclusions() { + return this.denyAssignmentExclusions; + } + + /** + * Set the denyAssignmentExclusions property: Deny Assignments exclusion list. + * + * @param denyAssignmentExclusions the denyAssignmentExclusions value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties + withDenyAssignmentExclusions(List denyAssignmentExclusions) { + this.denyAssignmentExclusions = denyAssignmentExclusions; + return this; + } + + /** + * Get the resourceState property: State of the resource. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Set the resourceState property: State of the resource. + * + * @param resourceState the resourceState value to set. + * @return the MdsResourceUpdateProperties object itself. + */ + public MdsResourceUpdateProperties withResourceState(ResourceState resourceState) { + this.resourceState = resourceState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (openAIProfile() != null) { + openAIProfile().validate(); + } + if (amlProfile() != null) { + amlProfile().validate(); + } + if (fabricProfile() != null) { + fabricProfile().validate(); + } + if (userManagedOpenAIProfile() != null) { + userManagedOpenAIProfile().validate(); + } + if (denyAssignmentExclusions() != null) { + denyAssignmentExclusions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeBooleanField("enableTeamsNotification", this.enableTeamsNotification); + jsonWriter.writeBooleanField("enableCopilot", this.enableCopilot); + jsonWriter.writeBooleanField("enableDiagnosticSettings", this.enableDiagnosticSettings); + jsonWriter.writeJsonField("openAIProfile", this.openAIProfile); + jsonWriter.writeJsonField("amlProfile", this.amlProfile); + jsonWriter.writeJsonField("fabricProfile", this.fabricProfile); + jsonWriter.writeJsonField("userManagedOpenAIProfile", this.userManagedOpenAIProfile); + jsonWriter.writeArrayField("denyAssignmentExclusions", this.denyAssignmentExclusions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceState", this.resourceState == null ? null : this.resourceState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MdsResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MdsResourceUpdateProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MdsResourceUpdateProperties. + */ + public static MdsResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MdsResourceUpdateProperties deserializedMdsResourceUpdateProperties = new MdsResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.version = reader.getString(); + } else if ("enableTeamsNotification".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.enableTeamsNotification + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableCopilot".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.enableCopilot = reader.getNullable(JsonReader::getBoolean); + } else if ("enableDiagnosticSettings".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.enableDiagnosticSettings + = reader.getNullable(JsonReader::getBoolean); + } else if ("openAIProfile".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.openAIProfile = OpenAIProfile.fromJson(reader); + } else if ("amlProfile".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.amlProfile = AmlProfileUpdate.fromJson(reader); + } else if ("fabricProfile".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.fabricProfile = FabricProfileUpdate.fromJson(reader); + } else if ("userManagedOpenAIProfile".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.userManagedOpenAIProfile + = UserManagedOpenAIProfileUpdate.fromJson(reader); + } else if ("denyAssignmentExclusions".equals(fieldName)) { + List denyAssignmentExclusions + = reader.readArray(reader1 -> DenyAssignmentExclusion.fromJson(reader1)); + deserializedMdsResourceUpdateProperties.denyAssignmentExclusions = denyAssignmentExclusions; + } else if ("resourceState".equals(fieldName)) { + deserializedMdsResourceUpdateProperties.resourceState + = ResourceState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMdsResourceUpdateProperties; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MoboBrokerResource.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MoboBrokerResource.java new file mode 100644 index 000000000000..a3d523ba7b53 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MoboBrokerResource.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MoboBroker resource. + */ +@Immutable +public final class MoboBrokerResource implements JsonSerializable { + /* + * Resource Id of MoboBrokerResource + */ + private String id; + + /** + * Creates an instance of MoboBrokerResource class. + */ + public MoboBrokerResource() { + } + + /** + * Get the id property: Resource Id of MoboBrokerResource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MoboBrokerResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MoboBrokerResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MoboBrokerResource. + */ + public static MoboBrokerResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MoboBrokerResource deserializedMoboBrokerResource = new MoboBrokerResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMoboBrokerResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMoboBrokerResource; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MonitoringProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MonitoringProfile.java new file mode 100644 index 000000000000..db6fd20a1b2d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/MonitoringProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Monitoring Resource. + */ +@Immutable +public final class MonitoringProfile implements JsonSerializable { + /* + * Resource Id of Application Insights Resource + */ + private String id; + + /** + * Creates an instance of MonitoringProfile class. + */ + public MonitoringProfile() { + } + + /** + * Get the id property: Resource Id of Application Insights Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringProfile. + */ + public static MonitoringProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringProfile deserializedMonitoringProfile = new MonitoringProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitoringProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OpenAIProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OpenAIProfile.java new file mode 100644 index 000000000000..4fb8a8de08f4 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OpenAIProfile.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to OpenAI Resource. + */ +@Fluent +public final class OpenAIProfile implements JsonSerializable { + /* + * Resource Id of OpenAI Resource + */ + private String id; + + /* + * GPT Model Name + */ + private String gptModelName; + + /* + * GPT Model Version + */ + private String gptModelVersion; + + /* + * GPT Model Capacity + */ + private Integer gptModelCapacity; + + /* + * GPT Model SKU Name + */ + private String gptModelSkuName; + + /* + * Embedding Model Name + */ + private String embeddingModelName; + + /* + * Embedding Model Version + */ + private String embeddingModelVersion; + + /* + * Embedding Model SKU Name + */ + private String embeddingModelSkuName; + + /* + * Embedding Model Capacity + */ + private Integer embeddingModelCapacity; + + /** + * Creates an instance of OpenAIProfile class. + */ + public OpenAIProfile() { + } + + /** + * Get the id property: Resource Id of OpenAI Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the gptModelName property: GPT Model Name. + * + * @return the gptModelName value. + */ + public String gptModelName() { + return this.gptModelName; + } + + /** + * Set the gptModelName property: GPT Model Name. + * + * @param gptModelName the gptModelName value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withGptModelName(String gptModelName) { + this.gptModelName = gptModelName; + return this; + } + + /** + * Get the gptModelVersion property: GPT Model Version. + * + * @return the gptModelVersion value. + */ + public String gptModelVersion() { + return this.gptModelVersion; + } + + /** + * Set the gptModelVersion property: GPT Model Version. + * + * @param gptModelVersion the gptModelVersion value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withGptModelVersion(String gptModelVersion) { + this.gptModelVersion = gptModelVersion; + return this; + } + + /** + * Get the gptModelCapacity property: GPT Model Capacity. + * + * @return the gptModelCapacity value. + */ + public Integer gptModelCapacity() { + return this.gptModelCapacity; + } + + /** + * Set the gptModelCapacity property: GPT Model Capacity. + * + * @param gptModelCapacity the gptModelCapacity value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withGptModelCapacity(Integer gptModelCapacity) { + this.gptModelCapacity = gptModelCapacity; + return this; + } + + /** + * Get the gptModelSkuName property: GPT Model SKU Name. + * + * @return the gptModelSkuName value. + */ + public String gptModelSkuName() { + return this.gptModelSkuName; + } + + /** + * Set the gptModelSkuName property: GPT Model SKU Name. + * + * @param gptModelSkuName the gptModelSkuName value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withGptModelSkuName(String gptModelSkuName) { + this.gptModelSkuName = gptModelSkuName; + return this; + } + + /** + * Get the embeddingModelName property: Embedding Model Name. + * + * @return the embeddingModelName value. + */ + public String embeddingModelName() { + return this.embeddingModelName; + } + + /** + * Set the embeddingModelName property: Embedding Model Name. + * + * @param embeddingModelName the embeddingModelName value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withEmbeddingModelName(String embeddingModelName) { + this.embeddingModelName = embeddingModelName; + return this; + } + + /** + * Get the embeddingModelVersion property: Embedding Model Version. + * + * @return the embeddingModelVersion value. + */ + public String embeddingModelVersion() { + return this.embeddingModelVersion; + } + + /** + * Set the embeddingModelVersion property: Embedding Model Version. + * + * @param embeddingModelVersion the embeddingModelVersion value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withEmbeddingModelVersion(String embeddingModelVersion) { + this.embeddingModelVersion = embeddingModelVersion; + return this; + } + + /** + * Get the embeddingModelSkuName property: Embedding Model SKU Name. + * + * @return the embeddingModelSkuName value. + */ + public String embeddingModelSkuName() { + return this.embeddingModelSkuName; + } + + /** + * Set the embeddingModelSkuName property: Embedding Model SKU Name. + * + * @param embeddingModelSkuName the embeddingModelSkuName value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withEmbeddingModelSkuName(String embeddingModelSkuName) { + this.embeddingModelSkuName = embeddingModelSkuName; + return this; + } + + /** + * Get the embeddingModelCapacity property: Embedding Model Capacity. + * + * @return the embeddingModelCapacity value. + */ + public Integer embeddingModelCapacity() { + return this.embeddingModelCapacity; + } + + /** + * Set the embeddingModelCapacity property: Embedding Model Capacity. + * + * @param embeddingModelCapacity the embeddingModelCapacity value to set. + * @return the OpenAIProfile object itself. + */ + public OpenAIProfile withEmbeddingModelCapacity(Integer embeddingModelCapacity) { + this.embeddingModelCapacity = embeddingModelCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gptModelName", this.gptModelName); + jsonWriter.writeStringField("gptModelVersion", this.gptModelVersion); + jsonWriter.writeNumberField("gptModelCapacity", this.gptModelCapacity); + jsonWriter.writeStringField("gptModelSkuName", this.gptModelSkuName); + jsonWriter.writeStringField("embeddingModelName", this.embeddingModelName); + jsonWriter.writeStringField("embeddingModelVersion", this.embeddingModelVersion); + jsonWriter.writeStringField("embeddingModelSkuName", this.embeddingModelSkuName); + jsonWriter.writeNumberField("embeddingModelCapacity", this.embeddingModelCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAIProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAIProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenAIProfile. + */ + public static OpenAIProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenAIProfile deserializedOpenAIProfile = new OpenAIProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOpenAIProfile.id = reader.getString(); + } else if ("gptModelName".equals(fieldName)) { + deserializedOpenAIProfile.gptModelName = reader.getString(); + } else if ("gptModelVersion".equals(fieldName)) { + deserializedOpenAIProfile.gptModelVersion = reader.getString(); + } else if ("gptModelCapacity".equals(fieldName)) { + deserializedOpenAIProfile.gptModelCapacity = reader.getNullable(JsonReader::getInt); + } else if ("gptModelSkuName".equals(fieldName)) { + deserializedOpenAIProfile.gptModelSkuName = reader.getString(); + } else if ("embeddingModelName".equals(fieldName)) { + deserializedOpenAIProfile.embeddingModelName = reader.getString(); + } else if ("embeddingModelVersion".equals(fieldName)) { + deserializedOpenAIProfile.embeddingModelVersion = reader.getString(); + } else if ("embeddingModelSkuName".equals(fieldName)) { + deserializedOpenAIProfile.embeddingModelSkuName = reader.getString(); + } else if ("embeddingModelCapacity".equals(fieldName)) { + deserializedOpenAIProfile.embeddingModelCapacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenAIProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operation.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operation.java new file mode 100644 index 000000000000..dc91d0c036a2 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationDisplay.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationDisplay.java new file mode 100644 index 000000000000..9cb9c25d21e5 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationListResult.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationListResult.java new file mode 100644 index 000000000000..bb11220002c1 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.manufacturingplatform.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operations.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operations.java new file mode 100644 index 000000000000..27502a759550 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Origin.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Origin.java new file mode 100644 index 000000000000..c94f14ea2b38 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Origin.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.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ProvisioningState.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ProvisioningState.java new file mode 100644 index 000000000000..0342f1580d4c --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ProvisioningState.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.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * 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"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + 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/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedisProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedisProfile.java new file mode 100644 index 000000000000..70daafbf01f6 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedisProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Azure Redis Cache Resource. + */ +@Immutable +public final class RedisProfile implements JsonSerializable { + /* + * Resource Id of Azure Redis Cache Resource + */ + private String id; + + /** + * Creates an instance of RedisProfile class. + */ + public RedisProfile() { + } + + /** + * Get the id property: Resource Id of Azure Redis Cache Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedisProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedisProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RedisProfile. + */ + public static RedisProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedisProfile deserializedRedisProfile = new RedisProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRedisProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRedisProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedundancyState.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedundancyState.java new file mode 100644 index 000000000000..2c1aa25bc867 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/RedundancyState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The redundancy state of the resource. + */ +public final class RedundancyState extends ExpandableStringEnum { + /** + * Static value Zonal for RedundancyState. + */ + public static final RedundancyState ZONAL = fromString("Zonal"); + + /** + * Static value None for RedundancyState. + */ + public static final RedundancyState NONE = fromString("None"); + + /** + * Creates a new instance of RedundancyState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedundancyState() { + } + + /** + * Creates or finds a RedundancyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedundancyState. + */ + public static RedundancyState fromString(String name) { + return fromString(name, RedundancyState.class); + } + + /** + * Gets known RedundancyState values. + * + * @return known RedundancyState values. + */ + public static Collection values() { + return values(RedundancyState.class); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ResourceState.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ResourceState.java new file mode 100644 index 000000000000..90ff237802f0 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/ResourceState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the resource. + */ +public final class ResourceState extends ExpandableStringEnum { + /** + * Static value Active for ResourceState. + */ + public static final ResourceState ACTIVE = fromString("Active"); + + /** + * Static value Inactive for ResourceState. + */ + public static final ResourceState INACTIVE = fromString("Inactive"); + + /** + * Creates a new instance of ResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceState() { + } + + /** + * Creates or finds a ResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceState. + */ + public static ResourceState fromString(String name) { + return fromString(name, ResourceState.class); + } + + /** + * Gets known ResourceState values. + * + * @return known ResourceState values. + */ + public static Collection values() { + return values(ResourceState.class); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Sku.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Sku.java new file mode 100644 index 000000000000..cfbbac2235cc --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/Sku.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource model definition representing SKU. + */ +@Fluent +public final class Sku implements JsonSerializable { + /* + * The name of the SKU. E.g. P3. It is typically a letter+number code + */ + private String name; + + /* + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is + * not required on a PUT. + */ + private SkuTier tier; + + /* + * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone + * code. + */ + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, then that can be captured here. + */ + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible + * for the resource this may be omitted. + */ + private Integer capacity; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeNumberField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedSku.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedSku.family = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedSku.capacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/SkuTier.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/SkuTier.java new file mode 100644 index 000000000000..ec8e1ab46379 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/SkuTier.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +/** + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not + * required on a PUT. + */ +public enum SkuTier { + /** + * Enum value Free. + */ + FREE("Free"), + + /** + * Enum value Basic. + */ + BASIC("Basic"), + + /** + * Enum value Standard. + */ + STANDARD("Standard"), + + /** + * Enum value Premium. + */ + PREMIUM("Premium"); + + /** + * The actual serialized value for a SkuTier instance. + */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + public static SkuTier fromString(String value) { + if (value == null) { + return null; + } + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/StorageProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/StorageProfile.java new file mode 100644 index 000000000000..e8082301cdbd --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/StorageProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to Storage Resource. + */ +@Immutable +public final class StorageProfile implements JsonSerializable { + /* + * Resource Id of Storage Resource + */ + private String id; + + /** + * Creates an instance of StorageProfile class. + */ + public StorageProfile() { + } + + /** + * Get the id property: Resource Id of Storage Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageProfile. + */ + public static StorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfile deserializedStorageProfile = new StorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserAssignedIdentity.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..3b326c66395f --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedAdxProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedAdxProfile.java new file mode 100644 index 000000000000..fa8dc54a5875 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedAdxProfile.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to User Managed Azure Data Explorer (Adx) Resource. + */ +@Fluent +public final class UserManagedAdxProfile implements JsonSerializable { + /* + * Resource Id of Adx Resource + */ + private String id; + + /* + * Uri of Adx Resource + */ + private String uri; + + /* + * Data Ingestion Uri of Adx Resource + */ + private String dataIngestionUri; + + /** + * Creates an instance of UserManagedAdxProfile class. + */ + public UserManagedAdxProfile() { + } + + /** + * Get the id property: Resource Id of Adx Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of Adx Resource. + * + * @param id the id value to set. + * @return the UserManagedAdxProfile object itself. + */ + public UserManagedAdxProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the uri property: Uri of Adx Resource. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: Data Ingestion Uri of Adx Resource. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model UserManagedAdxProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserManagedAdxProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserManagedAdxProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserManagedAdxProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserManagedAdxProfile. + */ + public static UserManagedAdxProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserManagedAdxProfile deserializedUserManagedAdxProfile = new UserManagedAdxProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUserManagedAdxProfile.id = reader.getString(); + } else if ("uri".equals(fieldName)) { + deserializedUserManagedAdxProfile.uri = reader.getString(); + } else if ("dataIngestionUri".equals(fieldName)) { + deserializedUserManagedAdxProfile.dataIngestionUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserManagedAdxProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedDatabaseProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedDatabaseProfile.java new file mode 100644 index 000000000000..fb8c30dc84af --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedDatabaseProfile.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.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to User Managed Database Resource. + */ +@Fluent +public final class UserManagedDatabaseProfile implements JsonSerializable { + /* + * Resource Id of Cosmos Resource + */ + private String cosmosId; + + /** + * Creates an instance of UserManagedDatabaseProfile class. + */ + public UserManagedDatabaseProfile() { + } + + /** + * Get the cosmosId property: Resource Id of Cosmos Resource. + * + * @return the cosmosId value. + */ + public String cosmosId() { + return this.cosmosId; + } + + /** + * Set the cosmosId property: Resource Id of Cosmos Resource. + * + * @param cosmosId the cosmosId value to set. + * @return the UserManagedDatabaseProfile object itself. + */ + public UserManagedDatabaseProfile withCosmosId(String cosmosId) { + this.cosmosId = cosmosId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cosmosId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cosmosId in model UserManagedDatabaseProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserManagedDatabaseProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cosmosId", this.cosmosId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserManagedDatabaseProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserManagedDatabaseProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserManagedDatabaseProfile. + */ + public static UserManagedDatabaseProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserManagedDatabaseProfile deserializedUserManagedDatabaseProfile = new UserManagedDatabaseProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cosmosId".equals(fieldName)) { + deserializedUserManagedDatabaseProfile.cosmosId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserManagedDatabaseProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfile.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfile.java new file mode 100644 index 000000000000..293fe266b698 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfile.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to User Managed OpenAI Resource. + */ +@Fluent +public final class UserManagedOpenAIProfile implements JsonSerializable { + /* + * Resource Id of OpenAI Resource + */ + private String id; + + /* + * GPT Model Deployment Name + */ + private String gptModelDeploymentName; + + /* + * Embedding Model Deployment Name + */ + private String embeddingModelDeploymentName; + + /* + * Embedding Model Type + */ + private String embeddingModelType; + + /** + * Creates an instance of UserManagedOpenAIProfile class. + */ + public UserManagedOpenAIProfile() { + } + + /** + * Get the id property: Resource Id of OpenAI Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of OpenAI Resource. + * + * @param id the id value to set. + * @return the UserManagedOpenAIProfile object itself. + */ + public UserManagedOpenAIProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the gptModelDeploymentName property: GPT Model Deployment Name. + * + * @return the gptModelDeploymentName value. + */ + public String gptModelDeploymentName() { + return this.gptModelDeploymentName; + } + + /** + * Set the gptModelDeploymentName property: GPT Model Deployment Name. + * + * @param gptModelDeploymentName the gptModelDeploymentName value to set. + * @return the UserManagedOpenAIProfile object itself. + */ + public UserManagedOpenAIProfile withGptModelDeploymentName(String gptModelDeploymentName) { + this.gptModelDeploymentName = gptModelDeploymentName; + return this; + } + + /** + * Get the embeddingModelDeploymentName property: Embedding Model Deployment Name. + * + * @return the embeddingModelDeploymentName value. + */ + public String embeddingModelDeploymentName() { + return this.embeddingModelDeploymentName; + } + + /** + * Set the embeddingModelDeploymentName property: Embedding Model Deployment Name. + * + * @param embeddingModelDeploymentName the embeddingModelDeploymentName value to set. + * @return the UserManagedOpenAIProfile object itself. + */ + public UserManagedOpenAIProfile withEmbeddingModelDeploymentName(String embeddingModelDeploymentName) { + this.embeddingModelDeploymentName = embeddingModelDeploymentName; + return this; + } + + /** + * Get the embeddingModelType property: Embedding Model Type. + * + * @return the embeddingModelType value. + */ + public String embeddingModelType() { + return this.embeddingModelType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model UserManagedOpenAIProfile")); + } + if (gptModelDeploymentName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property gptModelDeploymentName in model UserManagedOpenAIProfile")); + } + if (embeddingModelDeploymentName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property embeddingModelDeploymentName in model UserManagedOpenAIProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserManagedOpenAIProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("gptModelDeploymentName", this.gptModelDeploymentName); + jsonWriter.writeStringField("embeddingModelDeploymentName", this.embeddingModelDeploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserManagedOpenAIProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserManagedOpenAIProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserManagedOpenAIProfile. + */ + public static UserManagedOpenAIProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserManagedOpenAIProfile deserializedUserManagedOpenAIProfile = new UserManagedOpenAIProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUserManagedOpenAIProfile.id = reader.getString(); + } else if ("gptModelDeploymentName".equals(fieldName)) { + deserializedUserManagedOpenAIProfile.gptModelDeploymentName = reader.getString(); + } else if ("embeddingModelDeploymentName".equals(fieldName)) { + deserializedUserManagedOpenAIProfile.embeddingModelDeploymentName = reader.getString(); + } else if ("embeddingModelType".equals(fieldName)) { + deserializedUserManagedOpenAIProfile.embeddingModelType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserManagedOpenAIProfile; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfileUpdate.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfileUpdate.java new file mode 100644 index 000000000000..5e210147f57d --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/UserManagedOpenAIProfileUpdate.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties related to User Managed OpenAI Resource. + */ +@Fluent +public final class UserManagedOpenAIProfileUpdate implements JsonSerializable { + /* + * Resource Id of OpenAI Resource + */ + private String id; + + /* + * GPT Model Deployment Name + */ + private String gptModelDeploymentName; + + /* + * Embedding Model Deployment Name + */ + private String embeddingModelDeploymentName; + + /** + * Creates an instance of UserManagedOpenAIProfileUpdate class. + */ + public UserManagedOpenAIProfileUpdate() { + } + + /** + * Get the id property: Resource Id of OpenAI Resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of OpenAI Resource. + * + * @param id the id value to set. + * @return the UserManagedOpenAIProfileUpdate object itself. + */ + public UserManagedOpenAIProfileUpdate withId(String id) { + this.id = id; + return this; + } + + /** + * Get the gptModelDeploymentName property: GPT Model Deployment Name. + * + * @return the gptModelDeploymentName value. + */ + public String gptModelDeploymentName() { + return this.gptModelDeploymentName; + } + + /** + * Set the gptModelDeploymentName property: GPT Model Deployment Name. + * + * @param gptModelDeploymentName the gptModelDeploymentName value to set. + * @return the UserManagedOpenAIProfileUpdate object itself. + */ + public UserManagedOpenAIProfileUpdate withGptModelDeploymentName(String gptModelDeploymentName) { + this.gptModelDeploymentName = gptModelDeploymentName; + return this; + } + + /** + * Get the embeddingModelDeploymentName property: Embedding Model Deployment Name. + * + * @return the embeddingModelDeploymentName value. + */ + public String embeddingModelDeploymentName() { + return this.embeddingModelDeploymentName; + } + + /** + * Set the embeddingModelDeploymentName property: Embedding Model Deployment Name. + * + * @param embeddingModelDeploymentName the embeddingModelDeploymentName value to set. + * @return the UserManagedOpenAIProfileUpdate object itself. + */ + public UserManagedOpenAIProfileUpdate withEmbeddingModelDeploymentName(String embeddingModelDeploymentName) { + this.embeddingModelDeploymentName = embeddingModelDeploymentName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("gptModelDeploymentName", this.gptModelDeploymentName); + jsonWriter.writeStringField("embeddingModelDeploymentName", this.embeddingModelDeploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserManagedOpenAIProfileUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserManagedOpenAIProfileUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserManagedOpenAIProfileUpdate. + */ + public static UserManagedOpenAIProfileUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserManagedOpenAIProfileUpdate deserializedUserManagedOpenAIProfileUpdate + = new UserManagedOpenAIProfileUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUserManagedOpenAIProfileUpdate.id = reader.getString(); + } else if ("gptModelDeploymentName".equals(fieldName)) { + deserializedUserManagedOpenAIProfileUpdate.gptModelDeploymentName = reader.getString(); + } else if ("embeddingModelDeploymentName".equals(fieldName)) { + deserializedUserManagedOpenAIProfileUpdate.embeddingModelDeploymentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserManagedOpenAIProfileUpdate; + }); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/package-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/package-info.java new file mode 100644 index 000000000000..9659c22d14da --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for MicrosoftManufacturingPlatform. + * null. + */ +package com.azure.resourcemanager.manufacturingplatform.models; diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/package-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/package-info.java new file mode 100644 index 000000000000..5ce670bab12b --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/com/azure/resourcemanager/manufacturingplatform/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for MicrosoftManufacturingPlatform. + * null. + */ +package com.azure.resourcemanager.manufacturingplatform; diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/module-info.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/module-info.java new file mode 100644 index 000000000000..870def2b12b9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.manufacturingplatform { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.manufacturingplatform; + exports com.azure.resourcemanager.manufacturingplatform.fluent; + exports com.azure.resourcemanager.manufacturingplatform.fluent.models; + exports com.azure.resourcemanager.manufacturingplatform.models; + + opens com.azure.resourcemanager.manufacturingplatform.fluent.models to com.azure.core; + opens com.azure.resourcemanager.manufacturingplatform.models to com.azure.core; +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/proxy-config.json b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/proxy-config.json new file mode 100644 index 000000000000..a1ba67e47987 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.manufacturingplatform.implementation.ManufacturingDataServicesClientImpl$ManufacturingDataServicesService"],["com.azure.resourcemanager.manufacturingplatform.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/reflect-config.json b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-manufacturingplatform/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/azure-resourcemanager-manufacturingplatform.properties b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/azure-resourcemanager-manufacturingplatform.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/main/resources/azure-resourcemanager-manufacturingplatform.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesCreateOrUpdateSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c2c123bed8b6 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesCreateOrUpdateSamples.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.generated; + +import com.azure.resourcemanager.manufacturingplatform.models.AmlProfile; +import com.azure.resourcemanager.manufacturingplatform.models.CmkProfile; +import com.azure.resourcemanager.manufacturingplatform.models.DenyAssignmentExclusion; +import com.azure.resourcemanager.manufacturingplatform.models.FabricProfile; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceProperties; +import com.azure.resourcemanager.manufacturingplatform.models.OpenAIProfile; +import com.azure.resourcemanager.manufacturingplatform.models.RedundancyState; +import com.azure.resourcemanager.manufacturingplatform.models.ResourceState; +import com.azure.resourcemanager.manufacturingplatform.models.Sku; +import com.azure.resourcemanager.manufacturingplatform.models.SkuTier; +import com.azure.resourcemanager.manufacturingplatform.models.UserAssignedIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedAdxProfile; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedDatabaseProfile; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedOpenAIProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManufacturingDataServices CreateOrUpdate. + */ +public final class ManufacturingDataServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesCreateOrUpdateMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .define("-JC180-G53HQ-DV45--2") + .withRegion("gbr") + .withExistingResourceGroup("rgmanufacturingplatform") + .withTags(mapOf("key6832", "fakeTokenPlaceholder")) + .withProperties(new MdsResourceProperties().withVersion("syxboqeykgkjfooouymjnqjylnmkct") + .withEnableTeamsNotification(true) + .withEnableCopilot(true) + .withEnableDiagnosticSettings(true) + .withAadApplicationId("cBaEC5DF-CEaB-Ddae-ecbD-1Afabbd6DAe3") + .withAksAdminGroupId("dccAbeC7-84Eb-cbde-02Bd-B2cdfcaebb0D") + .withContinuousExportPeriod(12) + .withOpenAIProfile(new OpenAIProfile().withGptModelName("oclkeq") + .withGptModelVersion("paewwsvlhp") + .withGptModelCapacity(25) + .withGptModelSkuName("uuy") + .withEmbeddingModelName("xdqqhveootydkaed") + .withEmbeddingModelVersion("dddrtaedlevdqosxap") + .withEmbeddingModelSkuName("pdyhughmmkwmajeqlseuuydox") + .withEmbeddingModelCapacity(30)) + .withAmlProfile(new AmlProfile().withId("kunnf").withCustomNerServiceUri("ehvipfretszmxwelqee")) + .withUserManagedDatabaseProfile(new UserManagedDatabaseProfile().withCosmosId("sctcjvwhklehlk")) + .withUserManagedAdxProfile(new UserManagedAdxProfile().withId("wnmjzrhearzsdhveoadpag")) + .withCmkProfile(new CmkProfile().withKeyUri("fakeTokenPlaceholder")) + .withFabricProfile(new FabricProfile().withKeyUri("fakeTokenPlaceholder") + .withOneLakeUri("aamkzbolxdjqdptjiruahrl") + .withOneLakePath("hlcjgvamgtvmnxlcg")) + .withUserManagedOpenAIProfile(new UserManagedOpenAIProfile().withId("cqn") + .withGptModelDeploymentName("llyqusnsz") + .withEmbeddingModelDeploymentName("hybrb")) + .withDenyAssignmentExclusions(Arrays.asList( + new DenyAssignmentExclusion().withId("adxldjrbyhdovyxt").withType("tswtczntehsdxgmwkjmlffbkkkar"))) + .withResourceState(ResourceState.ACTIVE) + .withRedundancyState(RedundancyState.ZONAL)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key767", new UserAssignedIdentity()))) + .withSku(new Sku().withName("dfkkduhajxuswqtoyx") + .withTier(SkuTier.FREE) + .withSize("lunqammlzxjdvucllokewclfndgcp") + .withFamily("onfpel") + .withCapacity(3)) + .create(); + } + + // Use "Map.of" if available + @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/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesDeleteSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesDeleteSamples.java new file mode 100644 index 000000000000..5011774419b9 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.generated; + +/** + * Samples for ManufacturingDataServices Delete. + */ +public final class ManufacturingDataServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Delete_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesDeleteMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .delete("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesGetByResourceGroupSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d2b0f0647034 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesGetByResourceGroupSamples.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.manufacturingplatform.generated; + +/** + * Samples for ManufacturingDataServices GetByResourceGroup. + */ +public final class ManufacturingDataServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Get_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesGetMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .getByResourceGroupWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListAvailableVersionsSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListAvailableVersionsSamples.java new file mode 100644 index 000000000000..129e8e4943ea --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListAvailableVersionsSamples.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.manufacturingplatform.generated; + +/** + * Samples for ManufacturingDataServices ListAvailableVersions. + */ +public final class ManufacturingDataServicesListAvailableVersionsSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListAvailableVersions_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListAvailableVersions_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListAvailableVersionsMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .listAvailableVersionsWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListByResourceGroupSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..9a80d9cc3480 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.generated; + +/** + * Samples for ManufacturingDataServices ListByResourceGroup. + */ +public final class ManufacturingDataServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListByResourceGroupMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices() + .listByResourceGroup("rgmanufacturingplatform", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListSamples.java new file mode 100644 index 000000000000..e0280f8094ef --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesListSamples.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.manufacturingplatform.generated; + +/** + * Samples for ManufacturingDataServices List. + */ +public final class ManufacturingDataServicesListSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_ListBySubscription_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesListBySubscriptionMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.manufacturingDataServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesUpdateSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesUpdateSamples.java new file mode 100644 index 000000000000..a6738ed2308a --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/ManufacturingDataServicesUpdateSamples.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.generated; + +import com.azure.resourcemanager.manufacturingplatform.models.AmlProfileUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.AzureResourceManagerCommonTypesSkuUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.DenyAssignmentExclusion; +import com.azure.resourcemanager.manufacturingplatform.models.FabricProfileUpdate; +import com.azure.resourcemanager.manufacturingplatform.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResource; +import com.azure.resourcemanager.manufacturingplatform.models.MdsResourceUpdateProperties; +import com.azure.resourcemanager.manufacturingplatform.models.OpenAIProfile; +import com.azure.resourcemanager.manufacturingplatform.models.ResourceState; +import com.azure.resourcemanager.manufacturingplatform.models.SkuTier; +import com.azure.resourcemanager.manufacturingplatform.models.UserAssignedIdentity; +import com.azure.resourcemanager.manufacturingplatform.models.UserManagedOpenAIProfileUpdate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManufacturingDataServices Update. + */ +public final class ManufacturingDataServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/ManufacturingDataServices_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ManufacturingDataServices_Update_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void manufacturingDataServicesUpdateMaximumSet( + com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + MdsResource resource = manager.manufacturingDataServices() + .getByResourceGroupWithResponse("rgmanufacturingplatform", "-JC180-G53HQ-DV45--2", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key8765", "fakeTokenPlaceholder")) + .withIdentity(new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key5851", new UserAssignedIdentity()))) + .withSku(new AzureResourceManagerCommonTypesSkuUpdate().withName("rbwukuvzskhsarruzdkpxkjekxbc") + .withTier(SkuTier.FREE) + .withSize("ulsrkxmhtvulceyyzmknprvsyw") + .withFamily("uurphlxfxgzud") + .withCapacity(12)) + .withProperties(new MdsResourceUpdateProperties().withVersion("uihmagrnpqkkbjtsohqgyoxmoyrtg") + .withEnableTeamsNotification(true) + .withEnableCopilot(true) + .withEnableDiagnosticSettings(true) + .withOpenAIProfile(new OpenAIProfile().withGptModelName("oclkeq") + .withGptModelVersion("paewwsvlhp") + .withGptModelCapacity(25) + .withGptModelSkuName("uuy") + .withEmbeddingModelName("xdqqhveootydkaed") + .withEmbeddingModelVersion("dddrtaedlevdqosxap") + .withEmbeddingModelSkuName("pdyhughmmkwmajeqlseuuydox") + .withEmbeddingModelCapacity(30)) + .withAmlProfile(new AmlProfileUpdate().withId("qjr").withCustomNerServiceUri("vcnedenz")) + .withFabricProfile(new FabricProfileUpdate().withKeyUri("fakeTokenPlaceholder") + .withOneLakeUri("cbtxruhkzmsvxavtwp") + .withOneLakePath("wyxwdawtwcsuwyu")) + .withUserManagedOpenAIProfile(new UserManagedOpenAIProfileUpdate().withId("pbpgcwghuullcbapcpxllffkri") + .withGptModelDeploymentName("evqxxkkeguvpujjxwv") + .withEmbeddingModelDeploymentName("aofhgjrzwvlj")) + .withDenyAssignmentExclusions(Arrays.asList( + new DenyAssignmentExclusion().withId("adxldjrbyhdovyxt").withType("tswtczntehsdxgmwkjmlffbkkkar"))) + .withResourceState(ResourceState.ACTIVE)) + .apply(); + } + + // Use "Map.of" if available + @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/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/OperationsListSamples.java b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/OperationsListSamples.java new file mode 100644 index 000000000000..fa18d44ee6b6 --- /dev/null +++ b/sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/src/samples/java/com/azure/resourcemanager/manufacturingplatform/generated/OperationsListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.manufacturingplatform.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/manufacturingplatform/resource-manager/Microsoft.ManufacturingPlatform/preview/2024-02-01-preview/ + * examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to ManufacturingplatformManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.manufacturingplatform.ManufacturingplatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/manufacturingplatform/ci.yml b/sdk/manufacturingplatform/ci.yml new file mode 100644 index 000000000000..a3267873c54f --- /dev/null +++ b/sdk/manufacturingplatform/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/manufacturingplatform/ci.yml + - sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/ + exclude: + - sdk/manufacturingplatform/pom.xml + - sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/manufacturingplatform/ci.yml + - sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/ + exclude: + - sdk/manufacturingplatform/pom.xml + - sdk/manufacturingplatform/azure-resourcemanager-manufacturingplatform/pom.xml + +parameters: + - name: release_azureresourcemanagermanufacturingplatform + displayName: azure-resourcemanager-manufacturingplatform + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: manufacturingplatform + Artifacts: + - name: azure-resourcemanager-manufacturingplatform + groupId: com.azure.resourcemanager + safeName: azureresourcemanagermanufacturingplatform + releaseInBatch: ${{ parameters.release_azureresourcemanagermanufacturingplatform }} diff --git a/sdk/manufacturingplatform/pom.xml b/sdk/manufacturingplatform/pom.xml new file mode 100644 index 000000000000..d19716663a87 --- /dev/null +++ b/sdk/manufacturingplatform/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-manufacturingplatform-service + pom + 1.0.0 + + + azure-resourcemanager-manufacturingplatform + +