diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md index d636aa478548..b0ee416b9159 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-10-23) + +- Azure Resource Manager HybridNetwork client library for Java. This package contains Microsoft Azure SDK for HybridNetwork Management SDK. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md index b55f309569cc..b2a5e2863dd2 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridNetwork client library for Java. -This package contains Microsoft Azure SDK for HybridNetwork Management SDK. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2021-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridNetwork Management SDK. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridnetwork - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +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://docs.microsoft.com/java/azure/jdk/ +[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_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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fhybridnetwork%2Fazure-resourcemanager-hybridnetwork%2FREADME.png) diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/SAMPLE.md b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/SAMPLE.md index 33790e11be10..64680e7259a7 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/SAMPLE.md +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/SAMPLE.md @@ -1,237 +1,293 @@ # Code snippets and samples -## Devices +## ArtifactManifests -- [CreateOrUpdate](#devices_createorupdate) -- [Delete](#devices_delete) -- [GetByResourceGroup](#devices_getbyresourcegroup) -- [List](#devices_list) -- [ListByResourceGroup](#devices_listbyresourcegroup) -- [ListRegistrationKey](#devices_listregistrationkey) -- [UpdateTags](#devices_updatetags) +- [CreateOrUpdate](#artifactmanifests_createorupdate) +- [Delete](#artifactmanifests_delete) +- [Get](#artifactmanifests_get) +- [ListByArtifactStore](#artifactmanifests_listbyartifactstore) +- [ListCredential](#artifactmanifests_listcredential) +- [Update](#artifactmanifests_update) +- [UpdateState](#artifactmanifests_updatestate) -## NetworkFunctionVendorSkus +## ArtifactStores -- [ListBySku](#networkfunctionvendorskus_listbysku) -- [ListByVendor](#networkfunctionvendorskus_listbyvendor) +- [CreateOrUpdate](#artifactstores_createorupdate) +- [Delete](#artifactstores_delete) +- [Get](#artifactstores_get) +- [ListByPublisher](#artifactstores_listbypublisher) +- [Update](#artifactstores_update) -## NetworkFunctionVendors +## Components -- [List](#networkfunctionvendors_list) +- [Get](#components_get) +- [ListByNetworkFunction](#components_listbynetworkfunction) + +## ConfigurationGroupSchemas + +- [CreateOrUpdate](#configurationgroupschemas_createorupdate) +- [Delete](#configurationgroupschemas_delete) +- [Get](#configurationgroupschemas_get) +- [ListByPublisher](#configurationgroupschemas_listbypublisher) +- [Update](#configurationgroupschemas_update) +- [UpdateState](#configurationgroupschemas_updatestate) + +## ConfigurationGroupValues + +- [CreateOrUpdate](#configurationgroupvalues_createorupdate) +- [Delete](#configurationgroupvalues_delete) +- [GetByResourceGroup](#configurationgroupvalues_getbyresourcegroup) +- [List](#configurationgroupvalues_list) +- [ListByResourceGroup](#configurationgroupvalues_listbyresourcegroup) +- [UpdateTags](#configurationgroupvalues_updatetags) + +## NetworkFunctionDefinitionGroups + +- [CreateOrUpdate](#networkfunctiondefinitiongroups_createorupdate) +- [Delete](#networkfunctiondefinitiongroups_delete) +- [Get](#networkfunctiondefinitiongroups_get) +- [ListByPublisher](#networkfunctiondefinitiongroups_listbypublisher) +- [Update](#networkfunctiondefinitiongroups_update) + +## NetworkFunctionDefinitionVersions + +- [CreateOrUpdate](#networkfunctiondefinitionversions_createorupdate) +- [Delete](#networkfunctiondefinitionversions_delete) +- [Get](#networkfunctiondefinitionversions_get) +- [ListByNetworkFunctionDefinitionGroup](#networkfunctiondefinitionversions_listbynetworkfunctiondefinitiongroup) +- [Update](#networkfunctiondefinitionversions_update) +- [UpdateState](#networkfunctiondefinitionversions_updatestate) ## NetworkFunctions - [CreateOrUpdate](#networkfunctions_createorupdate) - [Delete](#networkfunctions_delete) +- [ExecuteRequest](#networkfunctions_executerequest) - [GetByResourceGroup](#networkfunctions_getbyresourcegroup) - [List](#networkfunctions_list) - [ListByResourceGroup](#networkfunctions_listbyresourcegroup) - [UpdateTags](#networkfunctions_updatetags) -## Operations +## NetworkServiceDesignGroups -- [List](#operations_list) +- [CreateOrUpdate](#networkservicedesigngroups_createorupdate) +- [Delete](#networkservicedesigngroups_delete) +- [Get](#networkservicedesigngroups_get) +- [ListByPublisher](#networkservicedesigngroups_listbypublisher) +- [Update](#networkservicedesigngroups_update) + +## NetworkServiceDesignVersions + +- [CreateOrUpdate](#networkservicedesignversions_createorupdate) +- [Delete](#networkservicedesignversions_delete) +- [Get](#networkservicedesignversions_get) +- [ListByNetworkServiceDesignGroup](#networkservicedesignversions_listbynetworkservicedesigngroup) +- [Update](#networkservicedesignversions_update) +- [UpdateState](#networkservicedesignversions_updatestate) -## RoleInstances +## Operations -- [Get](#roleinstances_get) -- [List](#roleinstances_list) -- [Restart](#roleinstances_restart) -- [Start](#roleinstances_start) -- [Stop](#roleinstances_stop) +- [List](#operations_list) -## VendorNetworkFunctions +## ProxyArtifact -- [CreateOrUpdate](#vendornetworkfunctions_createorupdate) -- [Get](#vendornetworkfunctions_get) -- [List](#vendornetworkfunctions_list) +- [Get](#proxyartifact_get) +- [List](#proxyartifact_list) +- [UpdateState](#proxyartifact_updatestate) -## VendorSkuPreview +## Publishers -- [CreateOrUpdate](#vendorskupreview_createorupdate) -- [Delete](#vendorskupreview_delete) -- [Get](#vendorskupreview_get) -- [List](#vendorskupreview_list) +- [CreateOrUpdate](#publishers_createorupdate) +- [Delete](#publishers_delete) +- [GetByResourceGroup](#publishers_getbyresourcegroup) +- [List](#publishers_list) +- [ListByResourceGroup](#publishers_listbyresourcegroup) +- [Update](#publishers_update) -## VendorSkus +## SiteNetworkServices -- [CreateOrUpdate](#vendorskus_createorupdate) -- [Delete](#vendorskus_delete) -- [Get](#vendorskus_get) -- [List](#vendorskus_list) +- [CreateOrUpdate](#sitenetworkservices_createorupdate) +- [Delete](#sitenetworkservices_delete) +- [GetByResourceGroup](#sitenetworkservices_getbyresourcegroup) +- [List](#sitenetworkservices_list) +- [ListByResourceGroup](#sitenetworkservices_listbyresourcegroup) +- [UpdateTags](#sitenetworkservices_updatetags) -## Vendors +## Sites -- [CreateOrUpdate](#vendors_createorupdate) -- [Delete](#vendors_delete) -- [Get](#vendors_get) -- [List](#vendors_list) -### Devices_CreateOrUpdate +- [CreateOrUpdate](#sites_createorupdate) +- [Delete](#sites_delete) +- [GetByResourceGroup](#sites_getbyresourcegroup) +- [List](#sites_list) +- [ListByResourceGroup](#sites_listbyresourcegroup) +- [UpdateTags](#sites_updatetags) +### ArtifactManifests_CreateOrUpdate ```java -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.hybridnetwork.models.AzureStackEdgeFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactType; +import com.azure.resourcemanager.hybridnetwork.models.ManifestArtifactFormat; +import java.util.Arrays; -/** Samples for Devices CreateOrUpdate. */ -public final class DevicesCreateOrUpdateSamples { +/** Samples for ArtifactManifests CreateOrUpdate. */ +public final class ArtifactManifestsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestCreate.json */ /** - * Sample code: Create or update device. + * Sample code: Create or update the artifact manifest resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void createOrUpdateDevice(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + public static void createOrUpdateTheArtifactManifestResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager - .devices() - .define("TestDevice") + .artifactManifests() + .define("TestManifest") .withRegion("eastus") - .withExistingResourceGroup("rg1") + .withExistingArtifactStore("rg", "TestPublisher", "TestArtifactStore") .withProperties( - new AzureStackEdgeFormat() - .withAzureStackEdge( - new SubResource() - .withId( - "/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"))) + new ArtifactManifestPropertiesFormat() + .withArtifacts( + Arrays + .asList( + new ManifestArtifactFormat() + .withArtifactName("fed-rbac") + .withArtifactType(ArtifactType.OCIARTIFACT) + .withArtifactVersion("1.0.0"), + new ManifestArtifactFormat() + .withArtifactName("nginx") + .withArtifactType(ArtifactType.OCIARTIFACT) + .withArtifactVersion("v1")))) .create(); } } ``` -### Devices_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for Devices Delete. */ -public final class DevicesDeleteSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceDelete.json - */ - /** - * Sample code: Delete device resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void deleteDeviceResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().delete("rg1", "TestDevice", Context.NONE); - } -} -``` - -### Devices_GetByResourceGroup +### ArtifactManifests_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Devices GetByResourceGroup. */ -public final class DevicesGetByResourceGroupSamples { +/** Samples for ArtifactManifests Delete. */ +public final class ArtifactManifestsDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestDelete.json */ /** - * Sample code: Get device resource. + * Sample code: Delete a artifact manifest resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getDeviceResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().getByResourceGroupWithResponse("rg1", "TestDevice", Context.NONE); + public static void deleteAArtifactManifestResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .delete("rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE); } } ``` -### Devices_List +### ArtifactManifests_Get ```java -import com.azure.core.util.Context; - -/** Samples for Devices List. */ -public final class DevicesListSamples { +/** Samples for ArtifactManifests Get. */ +public final class ArtifactManifestsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestGet.json */ /** - * Sample code: List all devices in a subscription. + * Sample code: Get a artifact manifest resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllDevicesInASubscription( + public static void getAArtifactManifestResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().list(Context.NONE); + manager + .artifactManifests() + .getWithResponse( + "rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE); } } ``` -### Devices_ListByResourceGroup +### ArtifactManifests_ListByArtifactStore ```java -import com.azure.core.util.Context; - -/** Samples for Devices ListByResourceGroup. */ -public final class DevicesListByResourceGroupSamples { +/** Samples for ArtifactManifests ListByArtifactStore. */ +public final class ArtifactManifestsListByArtifactStoreSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListByResourceGroup.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestListByArtifactStore.json */ /** - * Sample code: List all devices in resource group. + * Sample code: Get artifact manifest list resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllDevicesInResourceGroup( + public static void getArtifactManifestListResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().listByResourceGroup("rg1", Context.NONE); + manager + .artifactManifests() + .listByArtifactStore("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE); } } ``` -### Devices_ListRegistrationKey +### ArtifactManifests_ListCredential ```java -import com.azure.core.util.Context; - -/** Samples for Devices ListRegistrationKey. */ -public final class DevicesListRegistrationKeySamples { +/** Samples for ArtifactManifests ListCredential. */ +public final class ArtifactManifestsListCredentialSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListRegistrationKey.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestListCredential.json */ /** - * Sample code: Get device registration key. + * Sample code: List a credential for artifact manifest. * * @param manager Entry point to HybridNetworkManager. */ - public static void getDeviceRegistrationKey(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().listRegistrationKeyWithResponse("rg1", "TestDevice", Context.NONE); + public static void listACredentialForArtifactManifest( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .listCredentialWithResponse( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + com.azure.core.util.Context.NONE); } } ``` -### Devices_UpdateTags +### ArtifactManifests_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.models.Device; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifest; import java.util.HashMap; import java.util.Map; -/** Samples for Devices UpdateTags. */ -public final class DevicesUpdateTagsSamples { +/** Samples for ArtifactManifests Update. */ +public final class ArtifactManifestsUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceUpdateTags.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestUpdateTags.json */ /** - * Sample code: Update hybrid network device tags. + * Sample code: Update a artifact manifest resource tags. * * @param manager Entry point to HybridNetworkManager. */ - public static void updateHybridNetworkDeviceTags( + public static void updateAArtifactManifestResourceTags( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - Device resource = - manager.devices().getByResourceGroupWithResponse("rg1", "TestDevice", Context.NONE).getValue(); + ArtifactManifest resource = + manager + .artifactManifests() + .getWithResponse( + "rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -245,914 +301,2598 @@ public final class DevicesUpdateTagsSamples { } ``` -### NetworkFunctionVendorSkus_ListBySku +### ArtifactManifests_UpdateState ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestState; -/** Samples for NetworkFunctionVendorSkus ListBySku. */ -public final class NetworkFunctionVendorSkusListBySkuSamples { +/** Samples for ArtifactManifests UpdateState. */ +public final class ArtifactManifestsUpdateStateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuDetailsGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestUpdateState.json */ /** - * Sample code: Get network function sku details. + * Sample code: Update artifact manifest state. * * @param manager Entry point to HybridNetworkManager. */ - public static void getNetworkFunctionSkuDetails( + public static void updateArtifactManifestState( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendorSkus().listBySku("testVendor", "testSku", Context.NONE); + manager + .artifactManifests() + .updateState( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + new ArtifactManifestUpdateStateInner().withArtifactManifestState(ArtifactManifestState.UPLOADED), + com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctionVendorSkus_ListByVendor +### ArtifactStores_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactReplicationStrategy; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStoreType; -/** Samples for NetworkFunctionVendorSkus ListByVendor. */ -public final class NetworkFunctionVendorSkusListByVendorSamples { +/** Samples for ArtifactStores CreateOrUpdate. */ +public final class ArtifactStoresCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuListByVendor.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreCreate.json */ /** - * Sample code: List vendors and skus. + * Sample code: Create or update an artifact store of publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listVendorsAndSkus(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendorSkus().listByVendor("testVendor", Context.NONE); + public static void createOrUpdateAnArtifactStoreOfPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactStores() + .define("TestArtifactStore") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") + .withProperties( + new ArtifactStorePropertiesFormat() + .withStoreType(ArtifactStoreType.AZURE_CONTAINER_REGISTRY) + .withReplicationStrategy(ArtifactReplicationStrategy.SINGLE_REPLICATION) + .withManagedResourceGroupConfiguration( + new ArtifactStorePropertiesFormatManagedResourceGroupConfiguration() + .withName("testRg") + .withLocation("eastus"))) + .create(); } } ``` -### NetworkFunctionVendors_List +### ArtifactStores_Delete ```java -import com.azure.core.util.Context; - -/** Samples for NetworkFunctionVendors List. */ -public final class NetworkFunctionVendorsListSamples { +/** Samples for ArtifactStores Delete. */ +public final class ArtifactStoresDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionVendorAndSkuListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreDelete.json */ /** - * Sample code: List vendors and skus. + * Sample code: Delete a artifact store of publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listVendorsAndSkus(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendors().list(Context.NONE); + public static void deleteAArtifactStoreOfPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.artifactStores().delete("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctions_CreateOrUpdate +### ArtifactStores_Get ```java -import com.azure.core.management.SubResource; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for NetworkFunctions CreateOrUpdate. */ -public final class NetworkFunctionsCreateOrUpdateSamples { +/** Samples for ArtifactStores Get. */ +public final class ArtifactStoresGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreGet.json */ /** - * Sample code: Create network function resource. + * Sample code: Get a artifact store resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void createNetworkFunctionResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) throws IOException { + public static void getAArtifactStoreResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager - .networkFunctions() - .define("testNf") - .withRegion("eastus") - .withExistingResourceGroup("rg") - .withDevice( - new SubResource() - .withId( - "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice")) - .withSkuName("testSku") - .withVendorName("testVendor") - .withManagedApplicationParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkFunctionUserConfigurations( - Arrays - .asList( - new NetworkFunctionUserConfiguration() - .withRoleName("testRole") - .withUserDataParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("DC-97-F8-79-16-7D") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN))))) - .create(); + .artifactStores() + .getWithResponse("rg", "TestPublisher", "TestArtifactStoreName", com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctions_Delete +### ArtifactStores_ListByPublisher ```java -import com.azure.core.util.Context; - -/** Samples for NetworkFunctions Delete. */ -public final class NetworkFunctionsDeleteSamples { +/** Samples for ArtifactStores ListByPublisher. */ +public final class ArtifactStoresListByPublisherSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoresListByPublisherName.json */ /** - * Sample code: Delete network function resource. + * Sample code: Get application groups under a publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void deleteNetworkFunctionResource( + public static void getApplicationGroupsUnderAPublisherResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().delete("rg", "testNf", Context.NONE); + manager.artifactStores().listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctions_GetByResourceGroup +### ArtifactStores_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStore; +import java.util.HashMap; +import java.util.Map; -/** Samples for NetworkFunctions GetByResourceGroup. */ -public final class NetworkFunctionsGetByResourceGroupSamples { +/** Samples for ArtifactStores Update. */ +public final class ArtifactStoresUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreUpdateTags.json */ /** - * Sample code: Get network function resource. + * Sample code: Update artifact store resource tags. * * @param manager Entry point to HybridNetworkManager. */ - public static void getNetworkFunctionResource( + public static void updateArtifactStoreResourceTags( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", Context.NONE); + ArtifactStore resource = + manager + .artifactStores() + .getWithResponse("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; } } ``` -### NetworkFunctions_List +### Components_Get ```java -import com.azure.core.util.Context; - -/** Samples for NetworkFunctions List. */ -public final class NetworkFunctionsListSamples { +/** Samples for Components Get. */ +public final class ComponentsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ComponentGet.json */ /** - * Sample code: List all network function resources in subscription. + * Sample code: Get component resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllNetworkFunctionResourcesInSubscription( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().list(Context.NONE); + public static void getComponentResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.components().getWithResponse("rg", "testNf", "testComponent", com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctions_ListByResourceGroup +### Components_ListByNetworkFunction ```java -import com.azure.core.util.Context; - -/** Samples for NetworkFunctions ListByResourceGroup. */ -public final class NetworkFunctionsListByResourceGroupSamples { +/** Samples for Components ListByNetworkFunction. */ +public final class ComponentsListByNetworkFunctionSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListByResourceGroup.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ComponentListByNetworkFunction.json */ /** - * Sample code: List network function in resource group. + * Sample code: List components in network function. * * @param manager Entry point to HybridNetworkManager. */ - public static void listNetworkFunctionInResourceGroup( + public static void listComponentsInNetworkFunction( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().listByResourceGroup("rg", Context.NONE); + manager.components().listByNetworkFunction("rg", "testNf", com.azure.core.util.Context.NONE); } } ``` -### NetworkFunctions_UpdateTags +### ConfigurationGroupSchemas_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaPropertiesFormat; -/** Samples for NetworkFunctions UpdateTags. */ -public final class NetworkFunctionsUpdateTagsSamples { +/** Samples for ConfigurationGroupSchemas CreateOrUpdate. */ +public final class ConfigurationGroupSchemasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionUpdateTags.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaCreate.json */ /** - * Sample code: Update tags for network function resource. + * Sample code: Create or update the network function definition group. * * @param manager Entry point to HybridNetworkManager. */ - public static void updateTagsForNetworkFunctionResource( + public static void createOrUpdateTheNetworkFunctionDefinitionGroup( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - NetworkFunction resource = - manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + manager + .configurationGroupSchemas() + .define("testConfigurationGroupSchema") + .withRegion("westUs2") + .withExistingPublisher("rg1", "testPublisher") + .withProperties( + new ConfigurationGroupSchemaPropertiesFormat() + .withDescription("Schema with no secrets") + .withSchemaDefinition( + "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}")) + .create(); } } ``` -### Operations_List +### ConfigurationGroupSchemas_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** Samples for ConfigurationGroupSchemas Delete. */ +public final class ConfigurationGroupSchemasDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/GetOperations.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaDelete.json */ /** - * Sample code: Get Registration Operations. + * Sample code: Delete a network function group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getRegistrationOperations(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.operations().list(Context.NONE); + public static void deleteANetworkFunctionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupSchemas() + .delete("rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE); } } ``` -### RoleInstances_Get +### ConfigurationGroupSchemas_Get ```java -import com.azure.core.util.Context; - -/** Samples for RoleInstances Get. */ -public final class RoleInstancesGetSamples { +/** Samples for ConfigurationGroupSchemas Get. */ +public final class ConfigurationGroupSchemasGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaGet.json */ /** - * Sample code: Get the operational state of role instance of vendor network function. + * Sample code: Get a networkFunctionDefinition group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getTheOperationalStateOfRoleInstanceOfVendorNetworkFunction( + public static void getANetworkFunctionDefinitionGroupResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().getWithResponse("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); + manager + .configurationGroupSchemas() + .getWithResponse("rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE); } } ``` -### RoleInstances_List +### ConfigurationGroupSchemas_ListByPublisher ```java -import com.azure.core.util.Context; - -/** Samples for RoleInstances List. */ -public final class RoleInstancesListSamples { +/** Samples for ConfigurationGroupSchemas ListByPublisher. */ +public final class ConfigurationGroupSchemasListByPublisherSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceListByVendorNetworkFunction.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaListByPublisherName.json */ /** - * Sample code: List all role instances of vendor network function. + * Sample code: Get networkFunctionDefinition groups under publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllRoleInstancesOfVendorNetworkFunction( + public static void getNetworkFunctionDefinitionGroupsUnderPublisherResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().list("eastus", "testVendor", "testServiceKey", Context.NONE); + manager.configurationGroupSchemas().listByPublisher("rg1", "testPublisher", com.azure.core.util.Context.NONE); } } ``` -### RoleInstances_Restart +### ConfigurationGroupSchemas_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchema; +import java.util.HashMap; +import java.util.Map; -/** Samples for RoleInstances Restart. */ -public final class RoleInstancesRestartSamples { +/** Samples for ConfigurationGroupSchemas Update. */ +public final class ConfigurationGroupSchemasUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceRestart.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaUpdateTags.json */ /** - * Sample code: Restart a role instance of a vendor network function. + * Sample code: Create or update the configuration group schema resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void restartARoleInstanceOfAVendorNetworkFunction( + public static void createOrUpdateTheConfigurationGroupSchemaResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().restart("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); + ConfigurationGroupSchema resource = + manager + .configurationGroupSchemas() + .getWithResponse( + "rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; } } ``` -### RoleInstances_Start +### ConfigurationGroupSchemas_UpdateState ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; -/** Samples for RoleInstances Start. */ -public final class RoleInstancesStartSamples { +/** Samples for ConfigurationGroupSchemas UpdateState. */ +public final class ConfigurationGroupSchemasUpdateStateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStart.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaVersionUpdateState.json */ /** - * Sample code: Start a role instance of a vendor network function. + * Sample code: Update network service design version state. * * @param manager Entry point to HybridNetworkManager. */ - public static void startARoleInstanceOfAVendorNetworkFunction( + public static void updateNetworkServiceDesignVersionState( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().start("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); + manager + .configurationGroupSchemas() + .updateState( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + new ConfigurationGroupSchemaVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); } } ``` -### RoleInstances_Stop +### ConfigurationGroupValues_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithSecrets; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithoutSecrets; +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; -/** Samples for RoleInstances Stop. */ -public final class RoleInstancesStopSamples { +/** Samples for ConfigurationGroupValues CreateOrUpdate. */ +public final class ConfigurationGroupValuesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStop.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueCreate.json */ /** - * Sample code: Stop a role instance of a vendor network function. + * Sample code: Create or update configuration group value. * * @param manager Entry point to HybridNetworkManager. */ - public static void stopARoleInstanceOfAVendorNetworkFunction( + public static void createOrUpdateConfigurationGroupValue( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().stop("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); + manager + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithoutSecrets() + .withConfigurationGroupSchemaResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withConfigurationValue( + "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe" + + " one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe" + + " two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC" + + " 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC" + + " 2\",\"interconnects\":\"stripe-two\"}}}")) + .create(); } -} -``` - -### VendorNetworkFunctions_CreateOrUpdate - -```java -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.SshConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.SshPublicKey; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Arrays; -/** Samples for VendorNetworkFunctions CreateOrUpdate. */ -public final class VendorNetworkFunctionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueFirstPartyCreate.json */ /** - * Sample code: Create or update vendor network function sub resource. + * Sample code: Create or update first party configuration group value. * * @param manager Entry point to HybridNetworkManager. */ - public static void createOrUpdateVendorNetworkFunctionSubResource( + public static void createOrUpdateFirstPartyConfigurationGroupValue( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager - .vendorNetworkFunctions() - .define("testServiceKey") - .withExistingVendor("eastus", "testVendor") - .withVendorProvisioningState(VendorProvisioningState.PROVISIONING) - .withNetworkFunctionVendorConfigurations( - Arrays - .asList( - new NetworkFunctionVendorConfiguration() - .withRoleName("testRole") - .withOsProfile( - new OsProfile() - .withAdminUsername("dummyuser") - .withLinuxConfiguration( - new LinuxConfiguration() - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withPath("home/user/.ssh/authorized_keys") - .withKeyData( - "ssh-rsa" - + " AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS=" - + " user@constoso-DSH"))))) - .withCustomData("base-64 encoded string of custom data")) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("DC-97-F8-79-16-7D") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN))))) + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithoutSecrets() + .withConfigurationGroupSchemaResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withConfigurationValue( + "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe" + + " one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe" + + " two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC" + + " 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC" + + " 2\",\"interconnects\":\"stripe-two\"}}}")) .create(); } -} -``` - -### VendorNetworkFunctions_Get - -```java -import com.azure.core.util.Context; -/** Samples for VendorNetworkFunctions Get. */ -public final class VendorNetworkFunctionsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueCreateSecret.json */ /** - * Sample code: Get vendor network function sub resource by service key of network function. + * Sample code: Create or update configuration group value with secrets. * * @param manager Entry point to HybridNetworkManager. */ - public static void getVendorNetworkFunctionSubResourceByServiceKeyOfNetworkFunction( + public static void createOrUpdateConfigurationGroupValueWithSecrets( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorNetworkFunctions().getWithResponse("eastus", "testVendor", "testServiceKey", Context.NONE); + manager + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithSecrets() + .withConfigurationGroupSchemaResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withSecretConfigurationValue("fakeTokenPlaceholder")) + .create(); } } ``` -### VendorNetworkFunctions_List +### ConfigurationGroupValues_Delete ```java -import com.azure.core.util.Context; - -/** Samples for VendorNetworkFunctions List. */ -public final class VendorNetworkFunctionsListSamples { +/** Samples for ConfigurationGroupValues Delete. */ +public final class ConfigurationGroupValuesDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfListByVendor.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueDelete.json */ /** - * Sample code: List all nfs of vendor resource. + * Sample code: Delete hybrid configuration group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllNfsOfVendorResource( + public static void deleteHybridConfigurationGroupResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorNetworkFunctions().list("eastus", "testVendor", null, Context.NONE); + manager + .configurationGroupValues() + .delete("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE); } } ``` -### VendorSkuPreview_CreateOrUpdate +### ConfigurationGroupValues_GetByResourceGroup ```java -/** Samples for VendorSkuPreview CreateOrUpdate. */ -public final class VendorSkuPreviewCreateOrUpdateSamples { +/** Samples for ConfigurationGroupValues GetByResourceGroup. */ +public final class ConfigurationGroupValuesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueGet.json */ /** - * Sample code: Create or update preview subscription of vendor sku sub resource. + * Sample code: Get hybrid configuration group. * * @param manager Entry point to HybridNetworkManager. */ - public static void createOrUpdatePreviewSubscriptionOfVendorSkuSubResource( + public static void getHybridConfigurationGroup( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().define("previewSub").withExistingVendorSku("TestVendor", "TestSku").create(); + manager + .configurationGroupValues() + .getByResourceGroupWithResponse("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE); } } ``` -### VendorSkuPreview_Delete +### ConfigurationGroupValues_List ```java -import com.azure.core.util.Context; - -/** Samples for VendorSkuPreview Delete. */ -public final class VendorSkuPreviewDeleteSamples { +/** Samples for ConfigurationGroupValues List. */ +public final class ConfigurationGroupValuesListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueListBySubscription.json */ /** - * Sample code: Delete preview subscription of vendor sku sub resource. + * Sample code: List all hybrid network sites in a subscription. * * @param manager Entry point to HybridNetworkManager. */ - public static void deletePreviewSubscriptionOfVendorSkuSubResource( + public static void listAllHybridNetworkSitesInASubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().delete("TestVendor", "TestSku", "previewSub", Context.NONE); + manager.configurationGroupValues().list(com.azure.core.util.Context.NONE); } } ``` -### VendorSkuPreview_Get +### ConfigurationGroupValues_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for VendorSkuPreview Get. */ -public final class VendorSkuPreviewGetSamples { +/** Samples for ConfigurationGroupValues ListByResourceGroup. */ +public final class ConfigurationGroupValuesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueListByResourceGroup.json */ /** - * Sample code: Get preview subscription of vendor sku sub resource. + * Sample code: List all hybrid network configurationGroupValues in a subscription. * * @param manager Entry point to HybridNetworkManager. */ - public static void getPreviewSubscriptionOfVendorSkuSubResource( + public static void listAllHybridNetworkConfigurationGroupValuesInASubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().getWithResponse("TestVendor", "TestSku", "previewSub", Context.NONE); + manager.configurationGroupValues().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); } } ``` -### VendorSkuPreview_List +### ConfigurationGroupValues_UpdateTags ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValue; +import java.util.HashMap; +import java.util.Map; -/** Samples for VendorSkuPreview List. */ -public final class VendorSkuPreviewListSamples { +/** Samples for ConfigurationGroupValues UpdateTags. */ +public final class ConfigurationGroupValuesUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewListBySku.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueUpdateTags.json */ /** - * Sample code: List all preview subscriptions of vendor sku sub resource. + * Sample code: Update hybrid configuration group tags. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllPreviewSubscriptionsOfVendorSkuSubResource( + public static void updateHybridConfigurationGroupTags( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().list("TestVendor", "TestSku", Context.NONE); + ConfigurationGroupValue resource = + manager + .configurationGroupValues() + .getByResourceGroupWithResponse("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; } } ``` -### VendorSkus_CreateOrUpdate +### NetworkFunctionDefinitionGroups_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridnetwork.models.CustomProfile; -import com.azure.resourcemanager.hybridnetwork.models.DataDisk; -import com.azure.resourcemanager.hybridnetwork.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.hybridnetwork.models.ImageReference; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfigurationType; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes; -import com.azure.resourcemanager.hybridnetwork.models.OsDisk; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SshConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.SshPublicKey; -import com.azure.resourcemanager.hybridnetwork.models.StorageProfile; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk; -import com.azure.resourcemanager.hybridnetwork.models.VirtualMachineSizeTypes; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for VendorSkus CreateOrUpdate. */ -public final class VendorSkusCreateOrUpdateSamples { +/** Samples for NetworkFunctionDefinitionGroups CreateOrUpdate. */ +public final class NetworkFunctionDefinitionGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupCreate.json */ /** - * Sample code: Create or update the sku of vendor resource. + * Sample code: Create or update the network function definition group. * * @param manager Entry point to HybridNetworkManager. */ - public static void createOrUpdateTheSkuOfVendorResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) throws IOException { + public static void createOrUpdateTheNetworkFunctionDefinitionGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager - .vendorSkus() - .define("TestSku") - .withExistingVendor("TestVendor") - .withDeploymentMode(SkuDeploymentMode.PRIVATE_EDGE_ZONE) - .withPreview(true) - .withManagedApplicationTemplate( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkFunctionTemplate( - new NetworkFunctionTemplate() - .withNetworkFunctionRoleConfigurations( - Arrays - .asList( - new NetworkFunctionRoleConfiguration() - .withRoleName("test") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D3_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("dummyuser") - .withLinuxConfiguration( - new LinuxConfiguration() - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withPath("home/user/.ssh/authorized_keys") - .withKeyData( - "ssh-rsa" - + " AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS=" - + " user@constoso-DSH"))))) - .withCustomData("base-64 encoded string of custom data")) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT))) - .withStorageProfile( - new StorageProfile() - .withImageReference( - new ImageReference() - .withPublisher("Canonical") - .withOffer("UbuntuServer") - .withSku("18.04-LTS") - .withVersion("18.04.201804262")) - .withOsDisk( - new OsDisk() - .withOsType(OperatingSystemTypes.LINUX) - .withName("vhdName") - .withVhd( - new VirtualHardDisk() - .withUri( - "https://contoso.net/link/vnd.vhd?sp=rl&st=2020-10-08T20:38:19Z&se=2020-12-09T19:38:00Z&sv=2019-12-12&sr=b&sig=7BM2f4yOw%3D")) - .withDiskSizeGB(30)) - .withDataDisks( - Arrays - .asList( - new DataDisk() - .withCreateOption(DiskCreateOptionTypes.EMPTY) - .withName("DataDisk1") - .withDiskSizeGB(10)))) - .withCustomProfile( - new CustomProfile().withMetadataConfigurationPath("/var/logs/network.cfg"))))) + .networkFunctionDefinitionGroups() + .define("TestNetworkFunctionDefinitionGroupName") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") .create(); } } ``` -### VendorSkus_Delete +### NetworkFunctionDefinitionGroups_Delete ```java -import com.azure.core.util.Context; - -/** Samples for VendorSkus Delete. */ -public final class VendorSkusDeleteSamples { +/** Samples for NetworkFunctionDefinitionGroups Delete. */ +public final class NetworkFunctionDefinitionGroupsDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupDelete.json */ /** - * Sample code: Delete the sku of vendor resource. + * Sample code: Delete a network function group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void deleteTheSkuOfVendorResource( + public static void deleteANetworkFunctionGroupResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().delete("TestVendor", "TestSku", Context.NONE); + manager + .networkFunctionDefinitionGroups() + .delete("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE); } } ``` -### VendorSkus_Get +### NetworkFunctionDefinitionGroups_Get ```java -import com.azure.core.util.Context; - -/** Samples for VendorSkus Get. */ -public final class VendorSkusGetSamples { +/** Samples for NetworkFunctionDefinitionGroups Get. */ +public final class NetworkFunctionDefinitionGroupsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupGet.json */ /** - * Sample code: Get the sku of vendor resource. + * Sample code: Get a networkFunctionDefinition group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getTheSkuOfVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().getWithResponse("TestVendor", "TestSku", Context.NONE); + public static void getANetworkFunctionDefinitionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE); } } ``` -### VendorSkus_List +### NetworkFunctionDefinitionGroups_ListByPublisher ```java -import com.azure.core.util.Context; - -/** Samples for VendorSkus List. */ -public final class VendorSkusListSamples { +/** Samples for NetworkFunctionDefinitionGroups ListByPublisher. */ +public final class NetworkFunctionDefinitionGroupsListByPublisherSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuListByVendor.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupsListByPublisherName.json */ /** - * Sample code: List all the vendor skus of vendor resource. + * Sample code: Get networkFunctionDefinition groups under publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllTheVendorSkusOfVendorResource( + public static void getNetworkFunctionDefinitionGroupsUnderPublisherResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().list("TestVendor", Context.NONE); + manager + .networkFunctionDefinitionGroups() + .listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); } } ``` -### Vendors_CreateOrUpdate +### NetworkFunctionDefinitionGroups_Update ```java -/** Samples for Vendors CreateOrUpdate. */ -public final class VendorsCreateOrUpdateSamples { +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkFunctionDefinitionGroups Update. */ +public final class NetworkFunctionDefinitionGroupsUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupUpdateTags.json */ /** - * Sample code: Create or update Vendor resource. + * Sample code: Create or update the network function definition group resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void createOrUpdateVendorResource( + public static void createOrUpdateTheNetworkFunctionDefinitionGroupResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().define("TestVendor").create(); + NetworkFunctionDefinitionGroup resource = + manager + .networkFunctionDefinitionGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; } } ``` -### Vendors_Delete +### NetworkFunctionDefinitionVersions_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.models.ApplicationEnablement; +import com.azure.resourcemanager.hybridnetwork.models.ArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ArmTemplateMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesHelmApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionArmTemplateApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionVhdApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionArmTemplateApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionImageApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.ContainerizedNetworkFunctionDefinitionVersion; +import com.azure.resourcemanager.hybridnetwork.models.DependsOnProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmInstallOptions; +import com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfileOptions; +import com.azure.resourcemanager.hybridnetwork.models.HelmUpgradeOptions; +import com.azure.resourcemanager.hybridnetwork.models.ImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ImageMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.VhdImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.VhdImageMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.VirtualNetworkFunctionDefinitionVersion; +import java.util.Arrays; -/** Samples for Vendors Delete. */ -public final class VendorsDeleteSamples { +/** Samples for NetworkFunctionDefinitionVersions CreateOrUpdate. */ +public final class NetworkFunctionDefinitionVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json */ /** - * Sample code: Delete vendor resource. + * Sample code: Create or update a network function definition version resource for AzureCore VNF. * * @param manager Entry point to HybridNetworkManager. */ - public static void deleteVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().delete("TestVendor", Context.NONE); + public static void createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new VirtualNetworkFunctionDefinitionVersion() + .withDescription("test NFDV for AzureCore") + .withDeployParameters( + "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}") + .withNetworkFunctionTemplate( + new AzureCoreNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureCoreNetworkFunctionVhdApplication() + .withName("testImageRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureCoreVhdImageArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withVhdArtifactProfile( + new VhdImageArtifactProfile() + .withVhdName("test-image") + .withVhdVersion("1-0-0"))) + .withDeployParametersMappingRuleProfile( + new AzureCoreVhdImageDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withVhdImageMappingRuleProfile( + new VhdImageMappingRuleProfile().withUserConfiguration(""))), + new AzureCoreNetworkFunctionArmTemplateApplication() + .withName("testTemplateRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList("testImageRole")) + .withUninstallDependsOn(Arrays.asList("testImageRole")) + .withUpdateDependsOn(Arrays.asList("testImageRole"))) + .withArtifactProfile( + new AzureCoreArmTemplateArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withTemplateArtifactProfile( + new ArmTemplateArtifactProfile() + .withTemplateName("test-template") + .withTemplateVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureCoreArmTemplateDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withTemplateMappingRuleProfile( + new ArmTemplateMappingRuleProfile() + .withTemplateParameters( + "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}"))))))) + .create(); } -} -``` - -### Vendors_Get -```java -import com.azure.core.util.Context; - -/** Samples for Vendors Get. */ -public final class VendorsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json */ /** - * Sample code: Get Vendor resource. + * Sample code: Create or update a network function definition version resource for AzureOperatorNexus VNF. * * @param manager Entry point to HybridNetworkManager. */ - public static void getVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().getWithResponse("TestVendor", Context.NONE); + public static void createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new VirtualNetworkFunctionDefinitionVersion() + .withDescription("test NFDV for AzureOperatorNexus") + .withDeployParameters( + "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}") + .withNetworkFunctionTemplate( + new AzureOperatorNexusNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureOperatorNexusNetworkFunctionImageApplication() + .withName("testImageRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureOperatorNexusImageArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withImageArtifactProfile( + new ImageArtifactProfile() + .withImageName("test-image") + .withImageVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureOperatorNexusImageDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withImageMappingRuleProfile( + new ImageMappingRuleProfile().withUserConfiguration(""))), + new AzureOperatorNexusNetworkFunctionArmTemplateApplication() + .withName("testTemplateRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList("testImageRole")) + .withUninstallDependsOn(Arrays.asList("testImageRole")) + .withUpdateDependsOn(Arrays.asList("testImageRole"))) + .withArtifactProfile( + new AzureOperatorNexusArmTemplateArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withTemplateArtifactProfile( + new ArmTemplateArtifactProfile() + .withTemplateName("test-template") + .withTemplateVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureOperatorNexusArmTemplateDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withTemplateMappingRuleProfile( + new ArmTemplateMappingRuleProfile() + .withTemplateParameters( + "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}"))))))) + .create(); } -} -``` - -### Vendors_List -```java -import com.azure.core.util.Context; - -/** Samples for Vendors List. */ -public final class VendorsListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionCreate.json */ /** - * Sample code: List all vendor resources in subscription. + * Sample code: Create or update a network function definition version resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllVendorResourcesInSubscription( + public static void createOrUpdateANetworkFunctionDefinitionVersionResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().list(Context.NONE); + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new ContainerizedNetworkFunctionDefinitionVersion() + .withDeployParameters( + "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}") + .withNetworkFunctionTemplate( + new AzureArcKubernetesNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureArcKubernetesHelmApplication() + .withName("fedrbac") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureArcKubernetesArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore")) + .withHelmArtifactProfile( + new HelmArtifactProfile() + .withHelmPackageName("fed-rbac") + .withHelmPackageVersionRange("~2.1.3") + .withRegistryValuesPaths( + Arrays.asList("global.registry.docker.repoPath")) + .withImagePullSecretsValuesPaths( + Arrays.asList("global.imagePullSecrets")))) + .withDeployParametersMappingRuleProfile( + new AzureArcKubernetesDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.ENABLED) + .withHelmMappingRuleProfile( + new HelmMappingRuleProfile() + .withReleaseNamespace("{deployParameters.namesapce}") + .withReleaseName("{deployParameters.releaseName}") + .withHelmPackageVersion("2.1.3") + .withValues("") + .withOptions( + new HelmMappingRuleProfileOptions() + .withInstallOptions( + new HelmInstallOptions() + .withAtomic("true") + .withWait("waitValue") + .withTimeout("30")) + .withUpgradeOptions( + new HelmUpgradeOptions() + .withAtomic("true") + .withWait("waitValue") + .withTimeout("30"))))))))) + .create(); + } +} +``` + +### NetworkFunctionDefinitionVersions_Delete + +```java +/** Samples for NetworkFunctionDefinitionVersions Delete. */ +public final class NetworkFunctionDefinitionVersionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersion( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version for AzureOperatorNexus VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version for AzureCore VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersionForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctionDefinitionVersions_Get + +```java +/** Samples for NetworkFunctionDefinitionVersions Get. */ +public final class NetworkFunctionDefinitionVersionsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get a network function definition version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkFunctionDefinitionVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get network function definition version resource for AzureCore VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get network function definition version resource for AzureOperatorNexus VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctionDefinitionVersions_ListByNetworkFunctionDefinitionGroup + +```java +/** Samples for NetworkFunctionDefinitionVersions ListByNetworkFunctionDefinitionGroup. */ +public final class NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json + */ + /** + * Sample code: Get Publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .listByNetworkFunctionDefinitionGroup( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupNameName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctionDefinitionVersions_Update + +```java +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkFunctionDefinitionVersions Update. */ +public final class NetworkFunctionDefinitionVersionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionUpdateTags.json + */ + /** + * Sample code: Update the network function definition version tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateTheNetworkFunctionDefinitionVersionTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkFunctionDefinitionVersion resource = + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### NetworkFunctionDefinitionVersions_UpdateState + +```java +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +/** Samples for NetworkFunctionDefinitionVersions UpdateState. */ +public final class NetworkFunctionDefinitionVersionsUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionUpdateState.json + */ + /** + * Sample code: Update network function definition version state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkFunctionDefinitionVersionState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .updateState( + "rg", + "TestPublisher", + "TestSkuGroup", + "1.0.0", + new NetworkFunctionDefinitionVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithSecrets; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithoutSecrets; +import com.azure.resourcemanager.hybridnetwork.models.NfviType; +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; +import java.util.Arrays; + +/** Samples for NetworkFunctions CreateOrUpdate. */ +public final class NetworkFunctionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionCreate.json + */ + /** + * Sample code: Create virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_CORE) + .withNfviId("/subscriptions/subid/resourceGroups/testResourceGroup") + .withAllowSoftwareUpdate(false) + .withDeploymentValues( + "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa" + + " CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionFirstPartyCreate.json + */ + /** + * Sample code: Create first party network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createFirstPartyNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withDeploymentValues("{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionCreate.json + */ + /** + * Sample code: Create network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withDeploymentValues("{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionCreateSecret.json + */ + /** + * Sample code: Create network function resource with secrets. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createNetworkFunctionResourceWithSecrets( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withSecretDeploymentValues("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionCreate.json + */ + /** + * Sample code: Create virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_OPERATOR_NEXUS) + .withNfviId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withDeploymentValues( + "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa" + + " CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}")) + .create(); + } +} +``` + +### NetworkFunctions_Delete + +```java +/** Samples for NetworkFunctions Delete. */ +public final class NetworkFunctionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDelete.json + */ + /** + * Sample code: Delete network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDelete.json + */ + /** + * Sample code: Delete virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDelete.json + */ + /** + * Sample code: Delete virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_ExecuteRequest + +```java +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; +import com.azure.resourcemanager.hybridnetwork.models.HttpMethod; +import com.azure.resourcemanager.hybridnetwork.models.RequestMetadata; + +/** Samples for NetworkFunctions ExecuteRequest. */ +public final class NetworkFunctionsExecuteRequestSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionsExecuteRequest.json + */ + /** + * Sample code: Send request to network function services. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void sendRequestToNetworkFunctionServices( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .executeRequest( + "rg", + "testNetworkfunction", + new ExecuteRequestParameters() + .withServiceEndpoint("serviceEndpoint") + .withRequestMetadata( + new RequestMetadata() + .withRelativePath("/simProfiles/testSimProfile") + .withHttpMethod(HttpMethod.POST) + .withSerializedBody( + "{\"subscriptionProfile\":\"ChantestSubscription15\",\"permanentKey\":\"00112233445566778899AABBCCDDEEFF\",\"opcOperatorCode\":\"63bfa50ee6523365ff14c1f45f88737d\",\"staticIpAddresses\":{\"internet\":{\"ipv4Addr\":\"198.51.100.1\",\"ipv6Prefix\":\"2001:db8:abcd:12::0/64\"},\"another_network\":{\"ipv6Prefix\":\"2001:111:cdef:22::0/64\"}}}") + .withApiVersion("apiVersionQueryString")), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_GetByResourceGroup + +```java +/** Samples for NetworkFunctions GetByResourceGroup. */ +public final class NetworkFunctionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionGet.json + */ + /** + * Sample code: Get virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionGet.json + */ + /** + * Sample code: Get network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionGet.json + */ + /** + * Sample code: Get virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_List + +```java +/** Samples for NetworkFunctions List. */ +public final class NetworkFunctionsListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionListBySubscription.json + */ + /** + * Sample code: List all network function resources in subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllNetworkFunctionResourcesInSubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_ListByResourceGroup + +```java +/** Samples for NetworkFunctions ListByResourceGroup. */ +public final class NetworkFunctionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionListByResourceGroup.json + */ + /** + * Sample code: List network function in resource group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listNetworkFunctionInResourceGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFunctions_UpdateTags + +```java +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkFunctions UpdateTags. */ +public final class NetworkFunctionsUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionUpdateTags.json + */ + /** + * Sample code: Update tags for network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateTagsForNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkFunction resource = + manager + .networkFunctions() + .getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### NetworkServiceDesignGroups_CreateOrUpdate + +```java +/** Samples for NetworkServiceDesignGroups CreateOrUpdate. */ +public final class NetworkServiceDesignGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupCreate.json + */ + /** + * Sample code: Create or update the network service design group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkServiceDesignGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .define("TestNetworkServiceDesignGroupName") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") + .create(); + } +} +``` + +### NetworkServiceDesignGroups_Delete + +```java +/** Samples for NetworkServiceDesignGroups Delete. */ +public final class NetworkServiceDesignGroupsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupDelete.json + */ + /** + * Sample code: Delete a network function group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .delete("rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignGroups_Get + +```java +/** Samples for NetworkServiceDesignGroups Get. */ +public final class NetworkServiceDesignGroupsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupGet.json + */ + /** + * Sample code: Get a networkServiceDesign group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkServiceDesignGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignGroups_ListByPublisher + +```java +/** Samples for NetworkServiceDesignGroups ListByPublisher. */ +public final class NetworkServiceDesignGroupsListByPublisherSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupsListByPublisherName.json + */ + /** + * Sample code: Get networkServiceDesign groups under publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkServiceDesignGroupsUnderPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkServiceDesignGroups().listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignGroups_Update + +```java +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignGroups Update. */ +public final class NetworkServiceDesignGroupsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupUpdateTags.json + */ + /** + * Sample code: Create or update the network service design group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkServiceDesignGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkServiceDesignGroup resource = + manager + .networkServiceDesignGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### NetworkServiceDesignVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplate; +import com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplateDetails; +import com.azure.resourcemanager.hybridnetwork.models.DependsOnProfile; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.NsdArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.TemplateType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignVersions CreateOrUpdate. */ +public final class NetworkServiceDesignVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionCreate.json + */ + /** + * Sample code: Create or update a network service design version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateANetworkServiceDesignVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkServiceDesignGroup("rg", "TestPublisher", "TestNetworkServiceDesignGroupName") + .withProperties( + new NetworkServiceDesignVersionPropertiesFormat() + .withConfigurationGroupSchemaReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema"))) + .withResourceElementTemplates( + Arrays + .asList( + new ArmResourceDefinitionResourceElementTemplateDetails() + .withName("MyVM") + .withDependsOnProfile(new DependsOnProfile().withInstallDependsOn(Arrays.asList())) + .withConfiguration( + new ArmResourceDefinitionResourceElementTemplate() + .withTemplateType(TemplateType.ARM_TEMPLATE) + .withParameterValues( + "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}") + .withArtifactProfile( + new NsdArtifactProfile() + .withArtifactStoreReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1")) + .withArtifactName("MyVMArmTemplate") + .withArtifactVersion("1.0.0")))))) + .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; + } +} +``` + +### NetworkServiceDesignVersions_Delete + +```java +/** Samples for NetworkServiceDesignVersions Delete. */ +public final class NetworkServiceDesignVersionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionDelete.json + */ + /** + * Sample code: Delete a network service design version. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkServiceDesignVersion( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .delete( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", "1.0.0", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignVersions_Get + +```java +/** Samples for NetworkServiceDesignVersions Get. */ +public final class NetworkServiceDesignVersionsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionGet.json + */ + /** + * Sample code: Get a network service design version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkServiceDesignVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", "1.0.0", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignVersions_ListByNetworkServiceDesignGroup + +```java +/** Samples for NetworkServiceDesignVersions ListByNetworkServiceDesignGroup. */ +public final class NetworkServiceDesignVersionsListByNetworkServiceDesignGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json + */ + /** + * Sample code: Get Publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .listByNetworkServiceDesignGroup( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkServiceDesignVersions_Update + +```java +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignVersions Update. */ +public final class NetworkServiceDesignVersionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionUpdateTags.json + */ + /** + * Sample code: Update the network service design version tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateTheNetworkServiceDesignVersionTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkServiceDesignVersion resource = + manager + .networkServiceDesignVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### NetworkServiceDesignVersions_UpdateState + +```java +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +/** Samples for NetworkServiceDesignVersions UpdateState. */ +public final class NetworkServiceDesignVersionsUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionUpdateState.json + */ + /** + * Sample code: Update network service design version state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkServiceDesignVersionState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .updateState( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + new NetworkServiceDesignVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/GetOperations.json + */ + /** + * Sample code: Get Registration Operations. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getRegistrationOperations(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ProxyArtifact_Get + +```java +/** Samples for ProxyArtifact Get. */ +public final class ProxyArtifactGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactGet.json + */ + /** + * Sample code: Get an artifact overview. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getAnArtifactOverview(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .proxyArtifacts() + .get( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + com.azure.core.util.Context.NONE); + } +} +``` + +### ProxyArtifact_List + +```java +/** Samples for ProxyArtifact List. */ +public final class ProxyArtifactListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactList.json + */ + /** + * Sample code: List artifacts under an artifact store. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listArtifactsUnderAnArtifactStore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .proxyArtifacts() + .list("TestResourceGroup", "TestPublisher", "TestArtifactStoreName", com.azure.core.util.Context.NONE); + } +} +``` + +### ProxyArtifact_UpdateState + +```java +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeStateProperties; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactState; + +/** Samples for ProxyArtifact UpdateState. */ +public final class ProxyArtifactUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactChangeState.json + */ + /** + * Sample code: Update an artifact state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateAnArtifactState(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .proxyArtifacts() + .updateState( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + "1.0.0", + new ArtifactChangeState() + .withProperties(new ArtifactChangeStateProperties().withArtifactState(ArtifactState.DEPRECATED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridnetwork.models.PublisherPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.PublisherScope; + +/** Samples for Publishers CreateOrUpdate. */ +public final class PublishersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherCreate.json + */ + /** + * Sample code: Create or update a publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateAPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .publishers() + .define("TestPublisher") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties(new PublisherPropertiesFormat().withScope(PublisherScope.fromString("Public"))) + .create(); + } +} +``` + +### Publishers_Delete + +```java +/** Samples for Publishers Delete. */ +public final class PublishersDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherDelete.json + */ + /** + * Sample code: Delete a publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteAPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().delete("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_GetByResourceGroup + +```java +/** Samples for Publishers GetByResourceGroup. */ +public final class PublishersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherGet.json + */ + /** + * Sample code: Get a publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getAPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().getByResourceGroupWithResponse("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_List + +```java +/** Samples for Publishers List. */ +public final class PublishersListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherListBySubscription.json + */ + /** + * Sample code: List all publisher resources in a subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllPublisherResourcesInASubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_ListByResourceGroup + +```java +/** Samples for Publishers ListByResourceGroup. */ +public final class PublishersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherListByResourceGroup.json + */ + /** + * Sample code: List all publisher resources in a resource group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllPublisherResourcesInAResourceGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_Update + +```java +import com.azure.resourcemanager.hybridnetwork.models.Publisher; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Publishers Update. */ +public final class PublishersUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherUpdateTags.json + */ + /** + * Sample code: Update a publisher tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateAPublisherTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + Publisher resource = + manager + .publishers() + .getByResourceGroupWithResponse("rg", "TestPublisher", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### SiteNetworkServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServicePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.Sku; +import com.azure.resourcemanager.hybridnetwork.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SiteNetworkServices CreateOrUpdate. */ +public final class SiteNetworkServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceCreate.json + */ + /** + * Sample code: Create site network service. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createSiteNetworkService(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .define("testSiteNetworkServiceName") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SiteNetworkServicePropertiesFormat() + .withSiteReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite")) + .withNetworkServiceDesignVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0")) + .withDesiredStateConfigurationGroupValueReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1")))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceFirstPartyCreate.json + */ + /** + * Sample code: Create first party site network service. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createFirstPartySiteNetworkService( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .define("testSiteNetworkServiceName") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SiteNetworkServicePropertiesFormat() + .withSiteReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite")) + .withNetworkServiceDesignVersionResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0")) + .withDesiredStateConfigurationGroupValueReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1")))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .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; + } +} +``` + +### SiteNetworkServices_Delete + +```java +/** Samples for SiteNetworkServices Delete. */ +public final class SiteNetworkServicesDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceDelete.json + */ + /** + * Sample code: Delete network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.siteNetworkServices().delete("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE); + } +} +``` + +### SiteNetworkServices_GetByResourceGroup + +```java +/** Samples for SiteNetworkServices GetByResourceGroup. */ +public final class SiteNetworkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceGet.json + */ + /** + * Sample code: Get network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .getByResourceGroupWithResponse("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE); + } +} +``` + +### SiteNetworkServices_List + +```java +/** Samples for SiteNetworkServices List. */ +public final class SiteNetworkServicesListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceListBySubscription.json + */ + /** + * Sample code: List all hybrid network sites in a subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllHybridNetworkSitesInASubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.siteNetworkServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SiteNetworkServices_ListByResourceGroup + +```java +/** Samples for SiteNetworkServices ListByResourceGroup. */ +public final class SiteNetworkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceListByResourceGroup.json + */ + /** + * Sample code: List all network sites. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllNetworkSites(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.siteNetworkServices().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### SiteNetworkServices_UpdateTags + +```java +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SiteNetworkServices UpdateTags. */ +public final class SiteNetworkServicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceUpdateTags.json + */ + /** + * Sample code: Update network site tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkSiteTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + SiteNetworkService resource = + manager + .siteNetworkServices() + .getByResourceGroupWithResponse("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### Sites_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridnetwork.models.AzureArcK8SClusterNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusClusterNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.SitePropertiesFormat; +import java.util.Arrays; + +/** Samples for Sites CreateOrUpdate. */ +public final class SitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteCreate.json + */ + /** + * Sample code: Create network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .sites() + .define("testSite") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SitePropertiesFormat() + .withNfvis( + Arrays + .asList( + new AzureCoreNfviDetails().withName("nfvi1").withLocation("westUs2"), + new AzureArcK8SClusterNfviDetails() + .withName("nfvi2") + .withCustomLocationReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1")), + new AzureOperatorNexusClusterNfviDetails() + .withName("nfvi3") + .withCustomLocationReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2"))))) + .create(); + } +} +``` + +### Sites_Delete + +```java +/** Samples for Sites Delete. */ +public final class SitesDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteDelete.json + */ + /** + * Sample code: Delete network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().delete("rg1", "testSite", com.azure.core.util.Context.NONE); + } +} +``` + +### Sites_GetByResourceGroup + +```java +/** Samples for Sites GetByResourceGroup. */ +public final class SitesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteGet.json + */ + /** + * Sample code: Get network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().getByResourceGroupWithResponse("rg1", "testSite", com.azure.core.util.Context.NONE); + } +} +``` + +### Sites_List + +```java +/** Samples for Sites List. */ +public final class SitesListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteListBySubscription.json + */ + /** + * Sample code: List all hybrid network sites in a subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllHybridNetworkSitesInASubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Sites_ListByResourceGroup + +```java +/** Samples for Sites ListByResourceGroup. */ +public final class SitesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteListByResourceGroup.json + */ + /** + * Sample code: List all network sites. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllNetworkSites(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### Sites_UpdateTags + +```java +import com.azure.resourcemanager.hybridnetwork.models.Site; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sites UpdateTags. */ +public final class SitesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteUpdateTags.json + */ + /** + * Sample code: Update network site tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkSiteTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + Site resource = + manager + .sites() + .getByResourceGroupWithResponse("rg1", "testSite", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml index 6729e7dac330..9a0921d925e3 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for HybridNetwork Management - This package contains Microsoft Azure SDK for HybridNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2021-05-01. + This package contains Microsoft Azure SDK for HybridNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The definitions in this swagger specification will be used to manage the Hybrid Network resources. Package tag package-2023-09-01. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java index b301c2e9a364..158df664c9cd 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/HybridNetworkManager.java @@ -24,27 +24,37 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridnetwork.fluent.HybridNetworkManagementClient; -import com.azure.resourcemanager.hybridnetwork.implementation.DevicesImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.ArtifactManifestsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.ArtifactStoresImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.ComponentsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.ConfigurationGroupSchemasImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.ConfigurationGroupValuesImpl; import com.azure.resourcemanager.hybridnetwork.implementation.HybridNetworkManagementClientBuilder; -import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionVendorSkusImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionVendorsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionDefinitionGroupsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionDefinitionVersionsImpl; import com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkServiceDesignGroupsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.NetworkServiceDesignVersionsImpl; import com.azure.resourcemanager.hybridnetwork.implementation.OperationsImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.RoleInstancesImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.VendorNetworkFunctionsImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.VendorSkuPreviewsImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.VendorSkusImpl; -import com.azure.resourcemanager.hybridnetwork.implementation.VendorsImpl; -import com.azure.resourcemanager.hybridnetwork.models.Devices; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorSkus; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendors; +import com.azure.resourcemanager.hybridnetwork.implementation.ProxyArtifactsImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.PublishersImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.SiteNetworkServicesImpl; +import com.azure.resourcemanager.hybridnetwork.implementation.SitesImpl; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifests; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStores; +import com.azure.resourcemanager.hybridnetwork.models.Components; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemas; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValues; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroups; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersions; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctions; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroups; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersions; import com.azure.resourcemanager.hybridnetwork.models.Operations; -import com.azure.resourcemanager.hybridnetwork.models.RoleInstances; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctions; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkuPreviews; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkus; -import com.azure.resourcemanager.hybridnetwork.models.Vendors; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifacts; +import com.azure.resourcemanager.hybridnetwork.models.Publishers; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServices; +import com.azure.resourcemanager.hybridnetwork.models.Sites; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -57,25 +67,35 @@ * Network resources. */ public final class HybridNetworkManager { + private ConfigurationGroupSchemas configurationGroupSchemas; + + private ConfigurationGroupValues configurationGroupValues; + private NetworkFunctions networkFunctions; - private Devices devices; + private Components components; - private Operations operations; + private NetworkFunctionDefinitionGroups networkFunctionDefinitionGroups; + + private NetworkFunctionDefinitionVersions networkFunctionDefinitionVersions; + + private NetworkServiceDesignGroups networkServiceDesignGroups; + + private NetworkServiceDesignVersions networkServiceDesignVersions; - private Vendors vendors; + private Operations operations; - private VendorSkus vendorSkus; + private Publishers publishers; - private VendorSkuPreviews vendorSkuPreviews; + private ArtifactStores artifactStores; - private NetworkFunctionVendors networkFunctionVendors; + private ArtifactManifests artifactManifests; - private NetworkFunctionVendorSkus networkFunctionVendorSkus; + private ProxyArtifacts proxyArtifacts; - private VendorNetworkFunctions vendorNetworkFunctions; + private Sites sites; - private RoleInstances roleInstances; + private SiteNetworkServices siteNetworkServices; private final HybridNetworkManagementClient clientObject; @@ -242,7 +262,7 @@ public HybridNetworkManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.hybridnetwork") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -299,6 +319,32 @@ public HybridNetworkManager authenticate(TokenCredential credential, AzureProfil } } + /** + * Gets the resource collection API of ConfigurationGroupSchemas. It manages ConfigurationGroupSchema. + * + * @return Resource collection API of ConfigurationGroupSchemas. + */ + public ConfigurationGroupSchemas configurationGroupSchemas() { + if (this.configurationGroupSchemas == null) { + this.configurationGroupSchemas = + new ConfigurationGroupSchemasImpl(clientObject.getConfigurationGroupSchemas(), this); + } + return configurationGroupSchemas; + } + + /** + * Gets the resource collection API of ConfigurationGroupValues. It manages ConfigurationGroupValue. + * + * @return Resource collection API of ConfigurationGroupValues. + */ + public ConfigurationGroupValues configurationGroupValues() { + if (this.configurationGroupValues == null) { + this.configurationGroupValues = + new ConfigurationGroupValuesImpl(clientObject.getConfigurationGroupValues(), this); + } + return configurationGroupValues; + } + /** * Gets the resource collection API of NetworkFunctions. It manages NetworkFunction. * @@ -312,15 +358,68 @@ public NetworkFunctions networkFunctions() { } /** - * Gets the resource collection API of Devices. It manages Device. + * Gets the resource collection API of Components. + * + * @return Resource collection API of Components. + */ + public Components components() { + if (this.components == null) { + this.components = new ComponentsImpl(clientObject.getComponents(), this); + } + return components; + } + + /** + * Gets the resource collection API of NetworkFunctionDefinitionGroups. It manages NetworkFunctionDefinitionGroup. + * + * @return Resource collection API of NetworkFunctionDefinitionGroups. + */ + public NetworkFunctionDefinitionGroups networkFunctionDefinitionGroups() { + if (this.networkFunctionDefinitionGroups == null) { + this.networkFunctionDefinitionGroups = + new NetworkFunctionDefinitionGroupsImpl(clientObject.getNetworkFunctionDefinitionGroups(), this); + } + return networkFunctionDefinitionGroups; + } + + /** + * Gets the resource collection API of NetworkFunctionDefinitionVersions. It manages + * NetworkFunctionDefinitionVersion. + * + * @return Resource collection API of NetworkFunctionDefinitionVersions. + */ + public NetworkFunctionDefinitionVersions networkFunctionDefinitionVersions() { + if (this.networkFunctionDefinitionVersions == null) { + this.networkFunctionDefinitionVersions = + new NetworkFunctionDefinitionVersionsImpl(clientObject.getNetworkFunctionDefinitionVersions(), this); + } + return networkFunctionDefinitionVersions; + } + + /** + * Gets the resource collection API of NetworkServiceDesignGroups. It manages NetworkServiceDesignGroup. + * + * @return Resource collection API of NetworkServiceDesignGroups. + */ + public NetworkServiceDesignGroups networkServiceDesignGroups() { + if (this.networkServiceDesignGroups == null) { + this.networkServiceDesignGroups = + new NetworkServiceDesignGroupsImpl(clientObject.getNetworkServiceDesignGroups(), this); + } + return networkServiceDesignGroups; + } + + /** + * Gets the resource collection API of NetworkServiceDesignVersions. It manages NetworkServiceDesignVersion. * - * @return Resource collection API of Devices. + * @return Resource collection API of NetworkServiceDesignVersions. */ - public Devices devices() { - if (this.devices == null) { - this.devices = new DevicesImpl(clientObject.getDevices(), this); + public NetworkServiceDesignVersions networkServiceDesignVersions() { + if (this.networkServiceDesignVersions == null) { + this.networkServiceDesignVersions = + new NetworkServiceDesignVersionsImpl(clientObject.getNetworkServiceDesignVersions(), this); } - return devices; + return networkServiceDesignVersions; } /** @@ -336,95 +435,82 @@ public Operations operations() { } /** - * Gets the resource collection API of Vendors. It manages Vendor. + * Gets the resource collection API of Publishers. It manages Publisher. * - * @return Resource collection API of Vendors. + * @return Resource collection API of Publishers. */ - public Vendors vendors() { - if (this.vendors == null) { - this.vendors = new VendorsImpl(clientObject.getVendors(), this); + public Publishers publishers() { + if (this.publishers == null) { + this.publishers = new PublishersImpl(clientObject.getPublishers(), this); } - return vendors; + return publishers; } /** - * Gets the resource collection API of VendorSkus. It manages VendorSku. + * Gets the resource collection API of ArtifactStores. It manages ArtifactStore. * - * @return Resource collection API of VendorSkus. + * @return Resource collection API of ArtifactStores. */ - public VendorSkus vendorSkus() { - if (this.vendorSkus == null) { - this.vendorSkus = new VendorSkusImpl(clientObject.getVendorSkus(), this); + public ArtifactStores artifactStores() { + if (this.artifactStores == null) { + this.artifactStores = new ArtifactStoresImpl(clientObject.getArtifactStores(), this); } - return vendorSkus; + return artifactStores; } /** - * Gets the resource collection API of VendorSkuPreviews. It manages PreviewSubscription. + * Gets the resource collection API of ArtifactManifests. It manages ArtifactManifest. * - * @return Resource collection API of VendorSkuPreviews. + * @return Resource collection API of ArtifactManifests. */ - public VendorSkuPreviews vendorSkuPreviews() { - if (this.vendorSkuPreviews == null) { - this.vendorSkuPreviews = new VendorSkuPreviewsImpl(clientObject.getVendorSkuPreviews(), this); + public ArtifactManifests artifactManifests() { + if (this.artifactManifests == null) { + this.artifactManifests = new ArtifactManifestsImpl(clientObject.getArtifactManifests(), this); } - return vendorSkuPreviews; + return artifactManifests; } /** - * Gets the resource collection API of NetworkFunctionVendors. + * Gets the resource collection API of ProxyArtifacts. * - * @return Resource collection API of NetworkFunctionVendors. + * @return Resource collection API of ProxyArtifacts. */ - public NetworkFunctionVendors networkFunctionVendors() { - if (this.networkFunctionVendors == null) { - this.networkFunctionVendors = - new NetworkFunctionVendorsImpl(clientObject.getNetworkFunctionVendors(), this); + public ProxyArtifacts proxyArtifacts() { + if (this.proxyArtifacts == null) { + this.proxyArtifacts = new ProxyArtifactsImpl(clientObject.getProxyArtifacts(), this); } - return networkFunctionVendors; + return proxyArtifacts; } /** - * Gets the resource collection API of NetworkFunctionVendorSkus. + * Gets the resource collection API of Sites. It manages Site. * - * @return Resource collection API of NetworkFunctionVendorSkus. + * @return Resource collection API of Sites. */ - public NetworkFunctionVendorSkus networkFunctionVendorSkus() { - if (this.networkFunctionVendorSkus == null) { - this.networkFunctionVendorSkus = - new NetworkFunctionVendorSkusImpl(clientObject.getNetworkFunctionVendorSkus(), this); + public Sites sites() { + if (this.sites == null) { + this.sites = new SitesImpl(clientObject.getSites(), this); } - return networkFunctionVendorSkus; + return sites; } /** - * Gets the resource collection API of VendorNetworkFunctions. It manages VendorNetworkFunction. + * Gets the resource collection API of SiteNetworkServices. It manages SiteNetworkService. * - * @return Resource collection API of VendorNetworkFunctions. + * @return Resource collection API of SiteNetworkServices. */ - public VendorNetworkFunctions vendorNetworkFunctions() { - if (this.vendorNetworkFunctions == null) { - this.vendorNetworkFunctions = - new VendorNetworkFunctionsImpl(clientObject.getVendorNetworkFunctions(), this); + public SiteNetworkServices siteNetworkServices() { + if (this.siteNetworkServices == null) { + this.siteNetworkServices = new SiteNetworkServicesImpl(clientObject.getSiteNetworkServices(), this); } - return vendorNetworkFunctions; + return siteNetworkServices; } /** - * Gets the resource collection API of RoleInstances. + * Gets wrapped service client HybridNetworkManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. * - * @return Resource collection API of RoleInstances. - */ - public RoleInstances roleInstances() { - if (this.roleInstances == null) { - this.roleInstances = new RoleInstancesImpl(clientObject.getRoleInstances(), this); - } - return roleInstances; - } - - /** - * @return Wrapped service client HybridNetworkManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * @return Wrapped service client HybridNetworkManagementClient. */ public HybridNetworkManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactManifestsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactManifestsClient.java new file mode 100644 index 000000000000..eda09cc3af71 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactManifestsClient.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ArtifactManifestsClient. */ +public interface ArtifactManifestsClient { + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName); + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactManifestInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters); + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactManifestInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context); + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters); + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context); + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestInner get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters, + Context context); + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestInner update( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCredentialWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactAccessCredentialInner listCredential( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactManifestUpdateStateInner> beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactManifestUpdateStateInner> beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactManifestUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactStoresClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactStoresClient.java new file mode 100644 index 000000000000..3be6ba3ebfb9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ArtifactStoresClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ArtifactStoreInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ArtifactStoresClient. */ +public interface ArtifactStoresClient { + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String publisherName, Context context); + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String artifactStoreName); + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String artifactStoreName, Context context); + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String artifactStoreName); + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String artifactStoreName, Context context); + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactStoreInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters); + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArtifactStoreInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context); + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactStoreInner createOrUpdate( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters); + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactStoreInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context); + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactStoreInner get(String resourceGroupName, String publisherName, String artifactStoreName); + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + TagsObject parameters, + Context context); + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactStoreInner update( + String resourceGroupName, String publisherName, String artifactStoreName, TagsObject parameters); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ComponentsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ComponentsClient.java new file mode 100644 index 000000000000..26ca75323eb7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ComponentsClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; + +/** An instance of this class provides access to all the operations defined in ComponentsClient. */ +public interface ComponentsClient { + /** + * Gets information about the specified application instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkFunctionName, String componentName, Context context); + + /** + * Gets information about the specified application instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentInner get(String resourceGroupName, String networkFunctionName, String componentName); + + /** + * Lists all the component resources in a network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list component API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkFunction(String resourceGroupName, String networkFunctionName); + + /** + * Lists all the component resources in a network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list component API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkFunction( + String resourceGroupName, String networkFunctionName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupSchemasClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupSchemasClient.java new file mode 100644 index 000000000000..928165a38f93 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupSchemasClient.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ConfigurationGroupSchemasClient. */ +public interface ConfigurationGroupSchemasClient { + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String configurationGroupSchemaName); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String configurationGroupSchemaName, Context context); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String configurationGroupSchemaName); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String configurationGroupSchemaName, Context context); + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationGroupSchemaInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters); + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationGroupSchemaInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context); + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaInner createOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters); + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaInner createOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context); + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context); + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaInner get( + String resourceGroupName, String publisherName, String configurationGroupSchemaName); + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + TagsObject parameters, + Context context); + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaInner update( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, TagsObject parameters); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupSchemaVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupValuesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupValuesClient.java new file mode 100644 index 000000000000..4f76bc56bf91 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ConfigurationGroupValuesClient.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ConfigurationGroupValuesClient. */ +public interface ConfigurationGroupValuesClient { + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 configurationGroupValueName); + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 configurationGroupValueName, Context context); + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 configurationGroupValueName); + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 configurationGroupValueName, Context context); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String configurationGroupValueName, Context context); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupValueInner getByResourceGroup(String resourceGroupName, String configurationGroupValueName); + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationGroupValueInner> beginCreateOrUpdate( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters); + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationGroupValueInner> beginCreateOrUpdate( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context); + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupValueInner createOrUpdate( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters); + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupValueInner createOrUpdate( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context); + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters, Context context); + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationGroupValueInner updateTags( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters); + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java index a9613ddb088e..03a4e07592cd 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/HybridNetworkManagementClient.java @@ -44,6 +44,20 @@ public interface HybridNetworkManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the ConfigurationGroupSchemasClient object to access its operations. + * + * @return the ConfigurationGroupSchemasClient object. + */ + ConfigurationGroupSchemasClient getConfigurationGroupSchemas(); + + /** + * Gets the ConfigurationGroupValuesClient object to access its operations. + * + * @return the ConfigurationGroupValuesClient object. + */ + ConfigurationGroupValuesClient getConfigurationGroupValues(); + /** * Gets the NetworkFunctionsClient object to access its operations. * @@ -52,65 +66,86 @@ public interface HybridNetworkManagementClient { NetworkFunctionsClient getNetworkFunctions(); /** - * Gets the DevicesClient object to access its operations. + * Gets the ComponentsClient object to access its operations. * - * @return the DevicesClient object. + * @return the ComponentsClient object. */ - DevicesClient getDevices(); + ComponentsClient getComponents(); /** - * Gets the OperationsClient object to access its operations. + * Gets the NetworkFunctionDefinitionGroupsClient object to access its operations. * - * @return the OperationsClient object. + * @return the NetworkFunctionDefinitionGroupsClient object. */ - OperationsClient getOperations(); + NetworkFunctionDefinitionGroupsClient getNetworkFunctionDefinitionGroups(); + + /** + * Gets the NetworkFunctionDefinitionVersionsClient object to access its operations. + * + * @return the NetworkFunctionDefinitionVersionsClient object. + */ + NetworkFunctionDefinitionVersionsClient getNetworkFunctionDefinitionVersions(); /** - * Gets the VendorsClient object to access its operations. + * Gets the NetworkServiceDesignGroupsClient object to access its operations. * - * @return the VendorsClient object. + * @return the NetworkServiceDesignGroupsClient object. */ - VendorsClient getVendors(); + NetworkServiceDesignGroupsClient getNetworkServiceDesignGroups(); + + /** + * Gets the NetworkServiceDesignVersionsClient object to access its operations. + * + * @return the NetworkServiceDesignVersionsClient object. + */ + NetworkServiceDesignVersionsClient getNetworkServiceDesignVersions(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); /** - * Gets the VendorSkusClient object to access its operations. + * Gets the PublishersClient object to access its operations. * - * @return the VendorSkusClient object. + * @return the PublishersClient object. */ - VendorSkusClient getVendorSkus(); + PublishersClient getPublishers(); /** - * Gets the VendorSkuPreviewsClient object to access its operations. + * Gets the ArtifactStoresClient object to access its operations. * - * @return the VendorSkuPreviewsClient object. + * @return the ArtifactStoresClient object. */ - VendorSkuPreviewsClient getVendorSkuPreviews(); + ArtifactStoresClient getArtifactStores(); /** - * Gets the NetworkFunctionVendorsClient object to access its operations. + * Gets the ArtifactManifestsClient object to access its operations. * - * @return the NetworkFunctionVendorsClient object. + * @return the ArtifactManifestsClient object. */ - NetworkFunctionVendorsClient getNetworkFunctionVendors(); + ArtifactManifestsClient getArtifactManifests(); /** - * Gets the NetworkFunctionVendorSkusClient object to access its operations. + * Gets the ProxyArtifactsClient object to access its operations. * - * @return the NetworkFunctionVendorSkusClient object. + * @return the ProxyArtifactsClient object. */ - NetworkFunctionVendorSkusClient getNetworkFunctionVendorSkus(); + ProxyArtifactsClient getProxyArtifacts(); /** - * Gets the VendorNetworkFunctionsClient object to access its operations. + * Gets the SitesClient object to access its operations. * - * @return the VendorNetworkFunctionsClient object. + * @return the SitesClient object. */ - VendorNetworkFunctionsClient getVendorNetworkFunctions(); + SitesClient getSites(); /** - * Gets the RoleInstancesClient object to access its operations. + * Gets the SiteNetworkServicesClient object to access its operations. * - * @return the RoleInstancesClient object. + * @return the SiteNetworkServicesClient object. */ - RoleInstancesClient getRoleInstances(); + SiteNetworkServicesClient getSiteNetworkServices(); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionGroupsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionGroupsClient.java new file mode 100644 index 000000000000..e9d0c1b076e7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionGroupsClient.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkFunctionDefinitionGroupsClient. */ +public interface NetworkFunctionDefinitionGroupsClient { + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String networkFunctionDefinitionGroupName); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkFunctionDefinitionGroupName); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters); + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context); + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters); + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionGroupInner get( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName); + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters, + Context context); + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionGroupInner update( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionVersionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionVersionsClient.java new file mode 100644 index 000000000000..e5aac0fda98e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionDefinitionVersionsClient.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** + * An instance of this class provides access to all the operations defined in NetworkFunctionDefinitionVersionsClient. + */ +public interface NetworkFunctionDefinitionVersionsClient { + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName); + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context); + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName); + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context); + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters); + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context); + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters); + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context); + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context); + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionInner get( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName); + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters, + Context context); + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionInner update( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters); + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName); + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFunctionDefinitionVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.java deleted file mode 100644 index 9a527172f9f6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorSkusClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; - -/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorSkusClient. */ -public interface NetworkFunctionVendorSkusClient { - /** - * Lists all network function vendor sku details in a vendor. - * - * @param vendorName The name of the network function vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVendor(String vendorName); - - /** - * Lists all network function vendor sku details in a vendor. - * - * @param vendorName The name of the network function vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVendor(String vendorName, Context context); - - /** - * Lists information about network function vendor sku details. - * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySku(String vendorName, String vendorSkuName); - - /** - * Lists information about network function vendor sku details. - * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySku( - String vendorName, String vendorSkuName, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.java deleted file mode 100644 index 5fab9ee4f7eb..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionVendorsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkFunctionVendorInner; - -/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorsClient. */ -public interface NetworkFunctionVendorsClient { - /** - * Lists all the available vendor and sku information. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the available vendor and sku information. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java index 2dedd8da7eab..fc8172077c72 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkFunctionsClient.java @@ -12,13 +12,13 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; /** An instance of this class provides access to all the operations defined in NetworkFunctionsClient. */ public interface NetworkFunctionsClient { /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -31,8 +31,7 @@ public interface NetworkFunctionsClient { SyncPoller, Void> beginDelete(String resourceGroupName, String networkFunctionName); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -47,8 +46,7 @@ SyncPoller, Void> beginDelete( String resourceGroupName, String networkFunctionName, Context context); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -60,8 +58,7 @@ SyncPoller, Void> beginDelete( void delete(String resourceGroupName, String networkFunctionName); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -102,8 +99,7 @@ Response getByResourceGroupWithResponse( NetworkFunctionInner getByResourceGroup(String resourceGroupName, String networkFunctionName); /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -118,8 +114,7 @@ SyncPoller, NetworkFunctionInner> beginCreateOr String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters); /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -135,8 +130,7 @@ SyncPoller, NetworkFunctionInner> beginCreateOr String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context); /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -151,8 +145,7 @@ NetworkFunctionInner createOrUpdate( String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters); /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -243,4 +236,63 @@ Response updateTagsWithResponse( */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginExecuteRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters); + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginExecuteRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context); + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest(String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters); + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignGroupsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignGroupsClient.java new file mode 100644 index 000000000000..4d783be07e7c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignGroupsClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkServiceDesignGroupsClient. */ +public interface NetworkServiceDesignGroupsClient { + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String networkServiceDesignGroupName); + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, String networkServiceDesignGroupName, Context context); + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkServiceDesignGroupName); + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkServiceDesignGroupName, Context context); + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters); + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context); + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters); + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context); + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context); + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignGroupInner get( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName); + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + TagsObject parameters, + Context context); + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignGroupInner update( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, TagsObject parameters); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignVersionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignVersionsClient.java new file mode 100644 index 000000000000..0bc2771433d2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/NetworkServiceDesignVersionsClient.java @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkServiceDesignVersionsClient. */ +public interface NetworkServiceDesignVersionsClient { + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName); + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context); + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName); + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context); + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters); + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context); + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters); + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context); + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context); + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionInner get( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName); + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters, + Context context); + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionInner update( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters); + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName); + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkServiceDesignVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ProxyArtifactsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ProxyArtifactsClient.java new file mode 100644 index 000000000000..5727b4fa91d7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/ProxyArtifactsClient.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState; + +/** An instance of this class provides access to all the operations defined in ProxyArtifactsClient. */ +public interface ProxyArtifactsClient { + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName); + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName); + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName, Context context); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProxyArtifactVersionsListOverviewInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProxyArtifactVersionsListOverviewInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProxyArtifactVersionsListOverviewInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProxyArtifactVersionsListOverviewInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/PublishersClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/PublishersClient.java new file mode 100644 index 000000000000..11e7ba3855a9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/PublishersClient.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.PublisherInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PublishersClient. */ +public interface PublishersClient { + /** + * Lists all the publishers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the publishers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName); + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 publisherName, Context context); + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName); + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, Context context); + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String publisherName, Context context); + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner getByResourceGroup(String resourceGroupName, String publisherName); + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublisherInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName); + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublisherInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context); + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner createOrUpdate(String resourceGroupName, String publisherName); + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner createOrUpdate( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context); + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String publisherName, TagsObject parameters, Context context); + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner update(String resourceGroupName, String publisherName); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java deleted file mode 100644 index 30c3fa01b4d0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/RoleInstancesClient.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.RoleInstanceInner; - -/** An instance of this class provides access to all the operations defined in RoleInstancesClient. */ -public interface RoleInstancesClient { - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginStart( - String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginStart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 start(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 start(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginStop( - String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginStop( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stop(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stop(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginRestart( - String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginRestart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RoleInstanceInner get(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String vendorName, String serviceKey); - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String vendorName, String serviceKey, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SiteNetworkServicesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SiteNetworkServicesClient.java new file mode 100644 index 000000000000..68f031d94a45 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SiteNetworkServicesClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SiteNetworkServicesClient. */ +public interface SiteNetworkServicesClient { + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 siteNetworkServiceName); + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 siteNetworkServiceName, Context context); + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 siteNetworkServiceName); + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 siteNetworkServiceName, Context context); + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String siteNetworkServiceName, Context context); + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteNetworkServiceInner getByResourceGroup(String resourceGroupName, String siteNetworkServiceName); + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SiteNetworkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters); + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SiteNetworkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context); + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteNetworkServiceInner createOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters); + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteNetworkServiceInner createOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context); + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters, Context context); + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteNetworkServiceInner updateTags(String resourceGroupName, String siteNetworkServiceName, TagsObject parameters); + + /** + * Lists all sites in the network service in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all sites in the network service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SitesClient.java similarity index 61% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SitesClient.java index 043343eefa5d..0ee0dadb5718 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/DevicesClient.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/SitesClient.java @@ -11,30 +11,29 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; -/** An instance of this class provides access to all the operations defined in DevicesClient. */ -public interface DevicesClient { +/** An instance of this class provides access to all the operations defined in SitesClient. */ +public interface SitesClient { /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 deviceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String siteName); /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,222 +41,194 @@ public interface DevicesClient { * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String siteName, Context context); /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deviceName); + void delete(String resourceGroupName, String siteName); /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deviceName, Context context); + void delete(String resourceGroupName, String siteName, Context context); /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device along with {@link Response}. + * @return information about the specified network site along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String siteName, Context context); /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device. + * @return information about the specified network site. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner getByResourceGroup(String resourceGroupName, String deviceName); + SiteInner getByResourceGroup(String resourceGroupName, String siteName); /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of device resource. + * @return the {@link SyncPoller} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, String deviceName, DeviceInner parameters); + SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String siteName, SiteInner parameters); /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of device resource. + * @return the {@link SyncPoller} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context); + SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String siteName, SiteInner parameters, Context context); /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters); + SiteInner createOrUpdate(String resourceGroupName, String siteName, SiteInner parameters); /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters, Context context); + SiteInner createOrUpdate(String resourceGroupName, String siteName, SiteInner parameters, Context context); /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response}. + * @return site resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String deviceName, TagsObject parameters, Context context); + Response updateTagsWithResponse( + String resourceGroupName, String siteName, TagsObject parameters, Context context); /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner updateTags(String resourceGroupName, String deviceName, TagsObject parameters); + SiteInner updateTags(String resourceGroupName, String siteName, TagsObject parameters); /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listRegistrationKeyWithResponse( - String resourceGroupName, String deviceName, Context context); - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceRegistrationKeyInner listRegistrationKey(String resourceGroupName, String deviceName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java deleted file mode 100644 index 67954cc579a7..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorNetworkFunctionsClient.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.VendorNetworkFunctionInner; - -/** An instance of this class provides access to all the operations defined in VendorNetworkFunctionsClient. */ -public interface VendorNetworkFunctionsClient { - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String locationName, String vendorName, String serviceKey, Context context); - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorNetworkFunctionInner get(String locationName, String vendorName, String serviceKey); - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters); - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context); - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorNetworkFunctionInner createOrUpdate( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters); - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorNetworkFunctionInner createOrUpdate( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context); - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String vendorName); - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String locationName, String vendorName, String filter, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java deleted file mode 100644 index 9d9df80cdf94..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.PreviewSubscriptionInner; - -/** An instance of this class provides access to all the operations defined in VendorSkuPreviewsClient. */ -public interface VendorSkuPreviewsClient { - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vendorName, String skuName); - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vendorName, String skuName, Context context); - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters); - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context); - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PreviewSubscriptionInner createOrUpdate( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters); - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PreviewSubscriptionInner createOrUpdate( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context); - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 preview information of a vendor sku along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String vendorName, String skuName, String previewSubscription, Context context); - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PreviewSubscriptionInner get(String vendorName, String skuName, String previewSubscription); - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String vendorName, String skuName, String previewSubscription); - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String vendorName, String skuName, String previewSubscription, Context context); - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vendorName, String skuName, String previewSubscription); - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vendorName, String skuName, String previewSubscription, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java deleted file mode 100644 index 546984d1719b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkusClient.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.VendorSkuInner; - -/** An instance of this class provides access to all the operations defined in VendorSkusClient. */ -public interface VendorSkusClient { - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 vendorName, String skuName); - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 vendorName, String skuName, Context context); - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 vendorName, String skuName); - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 vendorName, String skuName, Context context); - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vendorName, String skuName, Context context); - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorSkuInner get(String vendorName, String skuName); - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorSkuInner> beginCreateOrUpdate( - String vendorName, String skuName, VendorSkuInner parameters); - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorSkuInner> beginCreateOrUpdate( - String vendorName, String skuName, VendorSkuInner parameters, Context context); - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters); - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters, Context context); - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vendorName); - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vendorName, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactAccessCredentialInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactAccessCredentialInner.java new file mode 100644 index 000000000000..911cd3c125a6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactAccessCredentialInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.hybridnetwork.models.AzureContainerRegistryScopedTokenCredential; +import com.azure.resourcemanager.hybridnetwork.models.AzureStorageAccountCredential; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The artifact manifest credential definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "credentialType", + defaultImpl = ArtifactAccessCredentialInner.class) +@JsonTypeName("ArtifactAccessCredential") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureContainerRegistryScopedToken", + value = AzureContainerRegistryScopedTokenCredential.class), + @JsonSubTypes.Type(name = "AzureStorageAccountToken", value = AzureStorageAccountCredential.class) +}) +@Immutable +public class ArtifactAccessCredentialInner { + /** Creates an instance of ArtifactAccessCredentialInner class. */ + public ArtifactAccessCredentialInner() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestInner.java new file mode 100644 index 000000000000..5b1b38138a05 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Artifact manifest properties. */ +@Fluent +public final class ArtifactManifestInner extends Resource { + /* + * Artifact manifest properties. + */ + @JsonProperty(value = "properties") + private ArtifactManifestPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArtifactManifestInner class. */ + public ArtifactManifestInner() { + } + + /** + * Get the properties property: Artifact manifest properties. + * + * @return the properties value. + */ + public ArtifactManifestPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Artifact manifest properties. + * + * @param properties the properties value to set. + * @return the ArtifactManifestInner object itself. + */ + public ArtifactManifestInner withProperties(ArtifactManifestPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ArtifactManifestInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ArtifactManifestInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestUpdateStateInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestUpdateStateInner.java new file mode 100644 index 000000000000..694e9aee69fa --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactManifestUpdateStateInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are + * used for internal state transitioning. + */ +@Fluent +public final class ArtifactManifestUpdateStateInner { + /* + * The artifact manifest state. + */ + @JsonProperty(value = "artifactManifestState") + private ArtifactManifestState artifactManifestState; + + /** Creates an instance of ArtifactManifestUpdateStateInner class. */ + public ArtifactManifestUpdateStateInner() { + } + + /** + * Get the artifactManifestState property: The artifact manifest state. + * + * @return the artifactManifestState value. + */ + public ArtifactManifestState artifactManifestState() { + return this.artifactManifestState; + } + + /** + * Set the artifactManifestState property: The artifact manifest state. + * + * @param artifactManifestState the artifactManifestState value to set. + * @return the ArtifactManifestUpdateStateInner object itself. + */ + public ArtifactManifestUpdateStateInner withArtifactManifestState(ArtifactManifestState artifactManifestState) { + this.artifactManifestState = artifactManifestState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactStoreInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactStoreInner.java new file mode 100644 index 000000000000..956c142ae4ff --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ArtifactStoreInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Artifact store properties. */ +@Fluent +public final class ArtifactStoreInner extends Resource { + /* + * ArtifactStores properties. + */ + @JsonProperty(value = "properties") + private ArtifactStorePropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArtifactStoreInner class. */ + public ArtifactStoreInner() { + } + + /** + * Get the properties property: ArtifactStores properties. + * + * @return the properties value. + */ + public ArtifactStorePropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: ArtifactStores properties. + * + * @param properties the properties value to set. + * @return the ArtifactStoreInner object itself. + */ + public ArtifactStoreInner withProperties(ArtifactStorePropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ArtifactStoreInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ArtifactStoreInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ComponentInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ComponentInner.java new file mode 100644 index 000000000000..3ecf6de685f5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ComponentInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ComponentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The component sub resource. */ +@Fluent +public final class ComponentInner extends ProxyResource { + /* + * The component properties. + */ + @JsonProperty(value = "properties") + private ComponentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ComponentInner class. */ + public ComponentInner() { + } + + /** + * Get the properties property: The component properties. + * + * @return the properties value. + */ + public ComponentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The component properties. + * + * @param properties the properties value to set. + * @return the ComponentInner object itself. + */ + public ComponentInner withProperties(ComponentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaInner.java new file mode 100644 index 000000000000..1e1506c7f79c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Configuration group schema resource. */ +@Fluent +public final class ConfigurationGroupSchemaInner extends Resource { + /* + * Configuration group schema properties. + */ + @JsonProperty(value = "properties") + private ConfigurationGroupSchemaPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ConfigurationGroupSchemaInner class. */ + public ConfigurationGroupSchemaInner() { + } + + /** + * Get the properties property: Configuration group schema properties. + * + * @return the properties value. + */ + public ConfigurationGroupSchemaPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Configuration group schema properties. + * + * @param properties the properties value to set. + * @return the ConfigurationGroupSchemaInner object itself. + */ + public ConfigurationGroupSchemaInner withProperties(ConfigurationGroupSchemaPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationGroupSchemaInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationGroupSchemaInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaVersionUpdateStateInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaVersionUpdateStateInner.java new file mode 100644 index 000000000000..75c96d26e81d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupSchemaVersionUpdateStateInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher configuration group schema update request definition. */ +@Fluent +public final class ConfigurationGroupSchemaVersionUpdateStateInner { + /* + * The configuration group schema state. + */ + @JsonProperty(value = "versionState") + private VersionState versionState; + + /** Creates an instance of ConfigurationGroupSchemaVersionUpdateStateInner class. */ + public ConfigurationGroupSchemaVersionUpdateStateInner() { + } + + /** + * Get the versionState property: The configuration group schema state. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Set the versionState property: The configuration group schema state. + * + * @param versionState the versionState value to set. + * @return the ConfigurationGroupSchemaVersionUpdateStateInner object itself. + */ + public ConfigurationGroupSchemaVersionUpdateStateInner withVersionState(VersionState versionState) { + this.versionState = versionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupValueInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupValueInner.java new file mode 100644 index 000000000000..4e2e0f619670 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ConfigurationGroupValueInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValuePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Hybrid configuration group value resource. */ +@Fluent +public final class ConfigurationGroupValueInner extends Resource { + /* + * Hybrid configuration group value properties. + */ + @JsonProperty(value = "properties") + private ConfigurationGroupValuePropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ConfigurationGroupValueInner class. */ + public ConfigurationGroupValueInner() { + } + + /** + * Get the properties property: Hybrid configuration group value properties. + * + * @return the properties value. + */ + public ConfigurationGroupValuePropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Hybrid configuration group value properties. + * + * @param properties the properties value to set. + * @return the ConfigurationGroupValueInner object itself. + */ + public ConfigurationGroupValueInner withProperties(ConfigurationGroupValuePropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationGroupValueInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationGroupValueInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java deleted file mode 100644 index 0dd55f2e410e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceRegistrationKeyInner.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The device registration key. */ -@Immutable -public final class DeviceRegistrationKeyInner { - /* - * The registration key for the device. - */ - @JsonProperty(value = "registrationKey", access = JsonProperty.Access.WRITE_ONLY) - private String registrationKey; - - /** Creates an instance of DeviceRegistrationKeyInner class. */ - public DeviceRegistrationKeyInner() { - } - - /** - * Get the registrationKey property: The registration key for the device. - * - * @return the registrationKey value. - */ - public String registrationKey() { - return this.registrationKey; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionGroupInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionGroupInner.java new file mode 100644 index 000000000000..0fd582a1af95 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionGroupInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroupPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network function definition group resource. */ +@Fluent +public final class NetworkFunctionDefinitionGroupInner extends Resource { + /* + * Network function definition group properties. + */ + @JsonProperty(value = "properties") + private NetworkFunctionDefinitionGroupPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkFunctionDefinitionGroupInner class. */ + public NetworkFunctionDefinitionGroupInner() { + } + + /** + * Get the properties property: Network function definition group properties. + * + * @return the properties value. + */ + public NetworkFunctionDefinitionGroupPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Network function definition group properties. + * + * @param properties the properties value to set. + * @return the NetworkFunctionDefinitionGroupInner object itself. + */ + public NetworkFunctionDefinitionGroupInner withProperties( + NetworkFunctionDefinitionGroupPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionGroupInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionInner.java new file mode 100644 index 000000000000..53c66c18e5a9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network function definition version. */ +@Fluent +public final class NetworkFunctionDefinitionVersionInner extends Resource { + /* + * Network function definition version properties. + */ + @JsonProperty(value = "properties") + private NetworkFunctionDefinitionVersionPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkFunctionDefinitionVersionInner class. */ + public NetworkFunctionDefinitionVersionInner() { + } + + /** + * Get the properties property: Network function definition version properties. + * + * @return the properties value. + */ + public NetworkFunctionDefinitionVersionPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Network function definition version properties. + * + * @param properties the properties value to set. + * @return the NetworkFunctionDefinitionVersionInner object itself. + */ + public NetworkFunctionDefinitionVersionInner withProperties( + NetworkFunctionDefinitionVersionPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionVersionInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionUpdateStateInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionUpdateStateInner.java new file mode 100644 index 000000000000..f59047934b2b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionDefinitionVersionUpdateStateInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher network function definition version update request definition. */ +@Fluent +public final class NetworkFunctionDefinitionVersionUpdateStateInner { + /* + * The network function definition version state. Only the 'Active' and 'Deprecated' states are allowed for + * updates. Other states are used for internal state transitioning. + */ + @JsonProperty(value = "versionState") + private VersionState versionState; + + /** Creates an instance of NetworkFunctionDefinitionVersionUpdateStateInner class. */ + public NetworkFunctionDefinitionVersionUpdateStateInner() { + } + + /** + * Get the versionState property: The network function definition version state. Only the 'Active' and 'Deprecated' + * states are allowed for updates. Other states are used for internal state transitioning. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Set the versionState property: The network function definition version state. Only the 'Active' and 'Deprecated' + * states are allowed for updates. Other states are used for internal state transitioning. + * + * @param versionState the versionState value to set. + * @return the NetworkFunctionDefinitionVersionUpdateStateInner object itself. + */ + public NetworkFunctionDefinitionVersionUpdateStateInner withVersionState(VersionState versionState) { + this.versionState = versionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java index 3bd864b9d556..739130a82971 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionInner.java @@ -6,14 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.management.SubResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionPropertiesFormat; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; /** Network function resource response. */ @@ -23,7 +19,7 @@ public final class NetworkFunctionInner extends Resource { * Network function properties. */ @JsonProperty(value = "properties") - private NetworkFunctionPropertiesFormat innerProperties; + private NetworkFunctionPropertiesFormat properties; /* * A unique read-only string that changes whenever the resource is updated. @@ -32,7 +28,13 @@ public final class NetworkFunctionInner extends Resource { private String etag; /* - * The system meta data relating to this resource. + * The managed identity of the network function. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -42,12 +44,23 @@ public NetworkFunctionInner() { } /** - * Get the innerProperties property: Network function properties. + * Get the properties property: Network function properties. + * + * @return the properties value. + */ + public NetworkFunctionPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Network function properties. * - * @return the innerProperties value. + * @param properties the properties value to set. + * @return the NetworkFunctionInner object itself. */ - private NetworkFunctionPropertiesFormat innerProperties() { - return this.innerProperties; + public NetworkFunctionInner withProperties(NetworkFunctionPropertiesFormat properties) { + this.properties = properties; + return this; } /** @@ -71,212 +84,45 @@ public NetworkFunctionInner withEtag(String etag) { } /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** {@inheritDoc} */ - @Override - public NetworkFunctionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NetworkFunctionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the network function resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the device property: The reference to the device resource. Once set, it cannot be updated. - * - * @return the device value. - */ - public SubResource device() { - return this.innerProperties() == null ? null : this.innerProperties().device(); - } - - /** - * Set the device property: The reference to the device resource. Once set, it cannot be updated. - * - * @param device the device value to set. - * @return the NetworkFunctionInner object itself. - */ - public NetworkFunctionInner withDevice(SubResource device) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withDevice(device); - return this; - } - - /** - * Get the skuName property: The sku name for the network function. Once set, it cannot be updated. - * - * @return the skuName value. - */ - public String skuName() { - return this.innerProperties() == null ? null : this.innerProperties().skuName(); - } - - /** - * Set the skuName property: The sku name for the network function. Once set, it cannot be updated. - * - * @param skuName the skuName value to set. - * @return the NetworkFunctionInner object itself. - */ - public NetworkFunctionInner withSkuName(String skuName) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withSkuName(skuName); - return this; - } - - /** - * Get the skuType property: The sku type for the network function. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.innerProperties() == null ? null : this.innerProperties().skuType(); - } - - /** - * Get the vendorName property: The vendor name for the network function. Once set, it cannot be updated. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Set the vendorName property: The vendor name for the network function. Once set, it cannot be updated. - * - * @param vendorName the vendorName value to set. - * @return the NetworkFunctionInner object itself. - */ - public NetworkFunctionInner withVendorName(String vendorName) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withVendorName(vendorName); - return this; - } - - /** - * Get the serviceKey property: The service key for the network function resource. - * - * @return the serviceKey value. - */ - public String serviceKey() { - return this.innerProperties() == null ? null : this.innerProperties().serviceKey(); - } - - /** - * Get the vendorProvisioningState property: The vendor provisioning state for the network function resource. - * - * @return the vendorProvisioningState value. - */ - public VendorProvisioningState vendorProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().vendorProvisioningState(); - } - - /** - * Get the managedApplication property: The resource URI of the managed application. - * - * @return the managedApplication value. - */ - public SubResource managedApplication() { - return this.innerProperties() == null ? null : this.innerProperties().managedApplication(); - } - - /** - * Get the managedApplicationParameters property: The parameters for the managed application. + * Get the identity property: The managed identity of the network function. * - * @return the managedApplicationParameters value. + * @return the identity value. */ - public Object managedApplicationParameters() { - return this.innerProperties() == null ? null : this.innerProperties().managedApplicationParameters(); + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Set the managedApplicationParameters property: The parameters for the managed application. + * Set the identity property: The managed identity of the network function. * - * @param managedApplicationParameters the managedApplicationParameters value to set. + * @param identity the identity value to set. * @return the NetworkFunctionInner object itself. */ - public NetworkFunctionInner withManagedApplicationParameters(Object managedApplicationParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withManagedApplicationParameters(managedApplicationParameters); + public NetworkFunctionInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; return this; } /** - * Get the networkFunctionContainerConfigurations property: The network function container configurations from the - * user. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the networkFunctionContainerConfigurations value. + * @return the systemData value. */ - public Object networkFunctionContainerConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().networkFunctionContainerConfigurations(); + public SystemData systemData() { + return this.systemData; } - /** - * Set the networkFunctionContainerConfigurations property: The network function container configurations from the - * user. - * - * @param networkFunctionContainerConfigurations the networkFunctionContainerConfigurations value to set. - * @return the NetworkFunctionInner object itself. - */ - public NetworkFunctionInner withNetworkFunctionContainerConfigurations( - Object networkFunctionContainerConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withNetworkFunctionContainerConfigurations(networkFunctionContainerConfigurations); + /** {@inheritDoc} */ + @Override + public NetworkFunctionInner withLocation(String location) { + super.withLocation(location); return this; } - /** - * Get the networkFunctionUserConfigurations property: The network function configurations from the user. - * - * @return the networkFunctionUserConfigurations value. - */ - public List networkFunctionUserConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().networkFunctionUserConfigurations(); - } - - /** - * Set the networkFunctionUserConfigurations property: The network function configurations from the user. - * - * @param networkFunctionUserConfigurations the networkFunctionUserConfigurations value to set. - * @return the NetworkFunctionInner object itself. - */ - public NetworkFunctionInner withNetworkFunctionUserConfigurations( - List networkFunctionUserConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new NetworkFunctionPropertiesFormat(); - } - this.innerProperties().withNetworkFunctionUserConfigurations(networkFunctionUserConfigurations); + /** {@inheritDoc} */ + @Override + public NetworkFunctionInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -286,8 +132,11 @@ public NetworkFunctionInner withNetworkFunctionUserConfigurations( * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); } } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionPropertiesFormat.java deleted file mode 100644 index e75f1b5cd0e9..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionPropertiesFormat.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network function properties. */ -@Fluent -public final class NetworkFunctionPropertiesFormat { - /* - * The provisioning state of the network function resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The reference to the device resource. Once set, it cannot be updated. - */ - @JsonProperty(value = "device") - private SubResource device; - - /* - * The sku name for the network function. Once set, it cannot be updated. - */ - @JsonProperty(value = "skuName") - private String skuName; - - /* - * The sku type for the network function. - */ - @JsonProperty(value = "skuType", access = JsonProperty.Access.WRITE_ONLY) - private SkuType skuType; - - /* - * The vendor name for the network function. Once set, it cannot be updated. - */ - @JsonProperty(value = "vendorName") - private String vendorName; - - /* - * The service key for the network function resource. - */ - @JsonProperty(value = "serviceKey", access = JsonProperty.Access.WRITE_ONLY) - private String serviceKey; - - /* - * The vendor provisioning state for the network function resource. - */ - @JsonProperty(value = "vendorProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private VendorProvisioningState vendorProvisioningState; - - /* - * The resource URI of the managed application. - */ - @JsonProperty(value = "managedApplication", access = JsonProperty.Access.WRITE_ONLY) - private SubResource managedApplication; - - /* - * The parameters for the managed application. - */ - @JsonProperty(value = "managedApplicationParameters") - private Object managedApplicationParameters; - - /* - * The network function container configurations from the user. - */ - @JsonProperty(value = "networkFunctionContainerConfigurations") - private Object networkFunctionContainerConfigurations; - - /* - * The network function configurations from the user. - */ - @JsonProperty(value = "networkFunctionUserConfigurations") - private List networkFunctionUserConfigurations; - - /** Creates an instance of NetworkFunctionPropertiesFormat class. */ - public NetworkFunctionPropertiesFormat() { - } - - /** - * Get the provisioningState property: The provisioning state of the network function resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the device property: The reference to the device resource. Once set, it cannot be updated. - * - * @return the device value. - */ - public SubResource device() { - return this.device; - } - - /** - * Set the device property: The reference to the device resource. Once set, it cannot be updated. - * - * @param device the device value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withDevice(SubResource device) { - this.device = device; - return this; - } - - /** - * Get the skuName property: The sku name for the network function. Once set, it cannot be updated. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Set the skuName property: The sku name for the network function. Once set, it cannot be updated. - * - * @param skuName the skuName value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - - /** - * Get the skuType property: The sku type for the network function. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.skuType; - } - - /** - * Get the vendorName property: The vendor name for the network function. Once set, it cannot be updated. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Set the vendorName property: The vendor name for the network function. Once set, it cannot be updated. - * - * @param vendorName the vendorName value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withVendorName(String vendorName) { - this.vendorName = vendorName; - return this; - } - - /** - * Get the serviceKey property: The service key for the network function resource. - * - * @return the serviceKey value. - */ - public String serviceKey() { - return this.serviceKey; - } - - /** - * Get the vendorProvisioningState property: The vendor provisioning state for the network function resource. - * - * @return the vendorProvisioningState value. - */ - public VendorProvisioningState vendorProvisioningState() { - return this.vendorProvisioningState; - } - - /** - * Get the managedApplication property: The resource URI of the managed application. - * - * @return the managedApplication value. - */ - public SubResource managedApplication() { - return this.managedApplication; - } - - /** - * Get the managedApplicationParameters property: The parameters for the managed application. - * - * @return the managedApplicationParameters value. - */ - public Object managedApplicationParameters() { - return this.managedApplicationParameters; - } - - /** - * Set the managedApplicationParameters property: The parameters for the managed application. - * - * @param managedApplicationParameters the managedApplicationParameters value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withManagedApplicationParameters(Object managedApplicationParameters) { - this.managedApplicationParameters = managedApplicationParameters; - return this; - } - - /** - * Get the networkFunctionContainerConfigurations property: The network function container configurations from the - * user. - * - * @return the networkFunctionContainerConfigurations value. - */ - public Object networkFunctionContainerConfigurations() { - return this.networkFunctionContainerConfigurations; - } - - /** - * Set the networkFunctionContainerConfigurations property: The network function container configurations from the - * user. - * - * @param networkFunctionContainerConfigurations the networkFunctionContainerConfigurations value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withNetworkFunctionContainerConfigurations( - Object networkFunctionContainerConfigurations) { - this.networkFunctionContainerConfigurations = networkFunctionContainerConfigurations; - return this; - } - - /** - * Get the networkFunctionUserConfigurations property: The network function configurations from the user. - * - * @return the networkFunctionUserConfigurations value. - */ - public List networkFunctionUserConfigurations() { - return this.networkFunctionUserConfigurations; - } - - /** - * Set the networkFunctionUserConfigurations property: The network function configurations from the user. - * - * @param networkFunctionUserConfigurations the networkFunctionUserConfigurations value to set. - * @return the NetworkFunctionPropertiesFormat object itself. - */ - public NetworkFunctionPropertiesFormat withNetworkFunctionUserConfigurations( - List networkFunctionUserConfigurations) { - this.networkFunctionUserConfigurations = networkFunctionUserConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkFunctionUserConfigurations() != null) { - networkFunctionUserConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java deleted file mode 100644 index 583cfb10ba90..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionSkuRoleDetailsInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network function user configuration. */ -@Fluent -public final class NetworkFunctionSkuRoleDetailsInner { - /* - * The name of the network function role. - */ - @JsonProperty(value = "roleName") - private String roleName; - - /* - * The user data template for customers. - */ - @JsonProperty(value = "userDataTemplate") - private Object userDataTemplate; - - /* - * The user parameters for customers. - */ - @JsonProperty(value = "userDataParameters") - private Object userDataParameters; - - /* - * The network interface configuration. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /** Creates an instance of NetworkFunctionSkuRoleDetailsInner class. */ - public NetworkFunctionSkuRoleDetailsInner() { - } - - /** - * Get the roleName property: The name of the network function role. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Set the roleName property: The name of the network function role. - * - * @param roleName the roleName value to set. - * @return the NetworkFunctionSkuRoleDetailsInner object itself. - */ - public NetworkFunctionSkuRoleDetailsInner withRoleName(String roleName) { - this.roleName = roleName; - return this; - } - - /** - * Get the userDataTemplate property: The user data template for customers. - * - * @return the userDataTemplate value. - */ - public Object userDataTemplate() { - return this.userDataTemplate; - } - - /** - * Set the userDataTemplate property: The user data template for customers. - * - * @param userDataTemplate the userDataTemplate value to set. - * @return the NetworkFunctionSkuRoleDetailsInner object itself. - */ - public NetworkFunctionSkuRoleDetailsInner withUserDataTemplate(Object userDataTemplate) { - this.userDataTemplate = userDataTemplate; - return this; - } - - /** - * Get the userDataParameters property: The user parameters for customers. - * - * @return the userDataParameters value. - */ - public Object userDataParameters() { - return this.userDataParameters; - } - - /** - * Set the userDataParameters property: The user parameters for customers. - * - * @param userDataParameters the userDataParameters value to set. - * @return the NetworkFunctionSkuRoleDetailsInner object itself. - */ - public NetworkFunctionSkuRoleDetailsInner withUserDataParameters(Object userDataParameters) { - this.userDataParameters = userDataParameters; - return this; - } - - /** - * Get the networkInterfaces property: The network interface configuration. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: The network interface configuration. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkFunctionSkuRoleDetailsInner object itself. - */ - public NetworkFunctionSkuRoleDetailsInner withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.java deleted file mode 100644 index 18c7c075c8b0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkFunctionVendorInner.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network function vendor. */ -@Fluent -public final class NetworkFunctionVendorInner { - /* - * Vendors of Hybrid Network service provider. - */ - @JsonProperty(value = "properties") - private VendorDetails innerProperties; - - /** Creates an instance of NetworkFunctionVendorInner class. */ - public NetworkFunctionVendorInner() { - } - - /** - * Get the innerProperties property: Vendors of Hybrid Network service provider. - * - * @return the innerProperties value. - */ - private VendorDetails innerProperties() { - return this.innerProperties; - } - - /** - * Get the vendorName property: The network function vendor name. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Set the vendorName property: The network function vendor name. - * - * @param vendorName the vendorName value to set. - * @return the NetworkFunctionVendorInner object itself. - */ - public NetworkFunctionVendorInner withVendorName(String vendorName) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorDetails(); - } - this.innerProperties().withVendorName(vendorName); - return this; - } - - /** - * Get the skuList property: The network function sku list. - * - * @return the skuList value. - */ - public List skuList() { - return this.innerProperties() == null ? null : this.innerProperties().skuList(); - } - - /** - * Set the skuList property: The network function sku list. - * - * @param skuList the skuList value to set. - * @return the NetworkFunctionVendorInner object itself. - */ - public NetworkFunctionVendorInner withSkuList(List skuList) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorDetails(); - } - this.innerProperties().withSkuList(skuList); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignGroupInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignGroupInner.java new file mode 100644 index 000000000000..1e3ca4a21e7f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignGroupInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroupPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** network service design group resource. */ +@Fluent +public final class NetworkServiceDesignGroupInner extends Resource { + /* + * network service design group properties. + */ + @JsonProperty(value = "properties") + private NetworkServiceDesignGroupPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkServiceDesignGroupInner class. */ + public NetworkServiceDesignGroupInner() { + } + + /** + * Get the properties property: network service design group properties. + * + * @return the properties value. + */ + public NetworkServiceDesignGroupPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: network service design group properties. + * + * @param properties the properties value to set. + * @return the NetworkServiceDesignGroupInner object itself. + */ + public NetworkServiceDesignGroupInner withProperties(NetworkServiceDesignGroupPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkServiceDesignGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkServiceDesignGroupInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionInner.java new file mode 100644 index 000000000000..a04f463c022c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** network service design version. */ +@Fluent +public final class NetworkServiceDesignVersionInner extends Resource { + /* + * network service design version properties. + */ + @JsonProperty(value = "properties") + private NetworkServiceDesignVersionPropertiesFormat properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkServiceDesignVersionInner class. */ + public NetworkServiceDesignVersionInner() { + } + + /** + * Get the properties property: network service design version properties. + * + * @return the properties value. + */ + public NetworkServiceDesignVersionPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: network service design version properties. + * + * @param properties the properties value to set. + * @return the NetworkServiceDesignVersionInner object itself. + */ + public NetworkServiceDesignVersionInner withProperties(NetworkServiceDesignVersionPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkServiceDesignVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkServiceDesignVersionInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionUpdateStateInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionUpdateStateInner.java new file mode 100644 index 000000000000..814249c58eee --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/NetworkServiceDesignVersionUpdateStateInner.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.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher network service design version update request definition. */ +@Fluent +public final class NetworkServiceDesignVersionUpdateStateInner { + /* + * The network service design version state. + */ + @JsonProperty(value = "versionState") + private VersionState versionState; + + /** Creates an instance of NetworkServiceDesignVersionUpdateStateInner class. */ + public NetworkServiceDesignVersionUpdateStateInner() { + } + + /** + * Get the versionState property: The network service design version state. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Set the versionState property: The network service design version state. + * + * @param versionState the versionState value to set. + * @return the NetworkServiceDesignVersionUpdateStateInner object itself. + */ + public NetworkServiceDesignVersionUpdateStateInner withVersionState(VersionState versionState) { + this.versionState = versionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java index 6a05664bf303..d26d3d8bd06d 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/OperationInner.java @@ -4,31 +4,59 @@ package com.azure.resourcemanager.hybridnetwork.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.models.ActionType; import com.azure.resourcemanager.hybridnetwork.models.OperationDisplay; +import com.azure.resourcemanager.hybridnetwork.models.Origin; import com.fasterxml.jackson.annotation.JsonProperty; -/** Object that describes a single Microsoft.HybridNetwork operation. */ -@Immutable +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent public final class OperationInner { /* - * Operation name: {provider}/{resource}/{operation}. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * The object that represents the operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. */ - @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") 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" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + /** Creates an instance of OperationInner class. */ public OperationInner() { } /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * 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. */ @@ -37,7 +65,17 @@ public String name() { } /** - * Get the display property: The object that represents the operation. + * 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. */ @@ -45,6 +83,37 @@ 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. * diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.java deleted file mode 100644 index 2eb3e6d0145e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionInner.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer subscription which can use a sku. */ -@Immutable -public final class PreviewSubscriptionInner extends ProxyResource { - /* - * The Preview Subscription properties. - */ - @JsonProperty(value = "properties") - private PreviewSubscriptionProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of PreviewSubscriptionInner class. */ - public PreviewSubscriptionInner() { - } - - /** - * Get the innerProperties property: The Preview Subscription properties. - * - * @return the innerProperties value. - */ - private PreviewSubscriptionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the provisioningState property: The provisioning state of the PreviewSubscription resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionProperties.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionProperties.java deleted file mode 100644 index 4733fc11ee47..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PreviewSubscriptionProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** PreviewSubscription properties. */ -@Immutable -public final class PreviewSubscriptionProperties { - /* - * The provisioning state of the PreviewSubscription resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** Creates an instance of PreviewSubscriptionProperties class. */ - public PreviewSubscriptionProperties() { - } - - /** - * Get the provisioningState property: The provisioning state of the PreviewSubscription resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactListOverviewInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactListOverviewInner.java new file mode 100644 index 000000000000..aa1580286414 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactListOverviewInner.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The proxy artifact overview. */ +@Immutable +public final class ProxyArtifactListOverviewInner extends ProxyResource { + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ProxyArtifactListOverviewInner class. */ + public ProxyArtifactListOverviewInner() { + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactVersionsListOverviewInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactVersionsListOverviewInner.java new file mode 100644 index 000000000000..eb22a64bb112 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/ProxyArtifactVersionsListOverviewInner.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactOverviewPropertiesValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The proxy artifact overview. */ +@Immutable +public final class ProxyArtifactVersionsListOverviewInner extends ProxyResource { + /* + * Proxy Artifact overview properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ProxyArtifactOverviewPropertiesValue properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ProxyArtifactVersionsListOverviewInner class. */ + public ProxyArtifactVersionsListOverviewInner() { + } + + /** + * Get the properties property: Proxy Artifact overview properties. + * + * @return the properties value. + */ + public ProxyArtifactOverviewPropertiesValue properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PublisherInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PublisherInner.java new file mode 100644 index 000000000000..cd4092cf3e78 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/PublisherInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; +import com.azure.resourcemanager.hybridnetwork.models.PublisherPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** publisher resource. */ +@Fluent +public final class PublisherInner extends Resource { + /* + * Publisher properties. + */ + @JsonProperty(value = "properties") + private PublisherPropertiesFormat properties; + + /* + * The managed identity of the publisher, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PublisherInner class. */ + public PublisherInner() { + } + + /** + * Get the properties property: Publisher properties. + * + * @return the properties value. + */ + public PublisherPropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Publisher properties. + * + * @param properties the properties value to set. + * @return the PublisherInner object itself. + */ + public PublisherInner withProperties(PublisherPropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed identity of the publisher, if configured. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity of the publisher, if configured. + * + * @param identity the identity value to set. + * @return the PublisherInner object itself. + */ + public PublisherInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public PublisherInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PublisherInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java deleted file mode 100644 index 0e026072ab57..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceInner.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The role instance sub resource. */ -@Fluent -public final class RoleInstanceInner extends ProxyResource { - /* - * The role instance name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The ARM ID of the resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The type of the resource. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The role instance properties. - */ - @JsonProperty(value = "properties") - private RoleInstanceProperties innerProperties; - - /* - * The system meta data relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of RoleInstanceInner class. */ - public RoleInstanceInner() { - } - - /** - * Get the name property: The role instance name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The role instance name. - * - * @param name the name value to set. - * @return the RoleInstanceInner object itself. - */ - public RoleInstanceInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: The ARM ID of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The ARM ID of the resource. - * - * @param id the id value to set. - * @return the RoleInstanceInner object itself. - */ - public RoleInstanceInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The type of the resource. - * - * @param type the type value to set. - * @return the RoleInstanceInner object itself. - */ - public RoleInstanceInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the innerProperties property: The role instance properties. - * - * @return the innerProperties value. - */ - private RoleInstanceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the provisioningState property: The provisioning state of the RoleInstance resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the operationalState property: The operational state of the role instance. - * - * @return the operationalState value. - */ - public OperationalState operationalState() { - return this.innerProperties() == null ? null : this.innerProperties().operationalState(); - } - - /** - * Set the operationalState property: The operational state of the role instance. - * - * @param operationalState the operationalState value to set. - * @return the RoleInstanceInner object itself. - */ - public RoleInstanceInner withOperationalState(OperationalState operationalState) { - if (this.innerProperties() == null) { - this.innerProperties = new RoleInstanceProperties(); - } - this.innerProperties().withOperationalState(operationalState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceProperties.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceProperties.java deleted file mode 100644 index 961ab84e208d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/RoleInstanceProperties.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The role instance properties of the network function. */ -@Fluent -public final class RoleInstanceProperties { - /* - * The provisioning state of the RoleInstance resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The operational state of the role instance. - */ - @JsonProperty(value = "operationalState") - private OperationalState operationalState; - - /** Creates an instance of RoleInstanceProperties class. */ - public RoleInstanceProperties() { - } - - /** - * Get the provisioningState property: The provisioning state of the RoleInstance resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the operationalState property: The operational state of the role instance. - * - * @return the operationalState value. - */ - public OperationalState operationalState() { - return this.operationalState; - } - - /** - * Set the operationalState property: The operational state of the role instance. - * - * @param operationalState the operationalState value to set. - * @return the RoleInstanceProperties object itself. - */ - public RoleInstanceProperties withOperationalState(OperationalState operationalState) { - this.operationalState = operationalState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteInner.java similarity index 62% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteInner.java index 42b885e416dd..3f4297853445 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/DeviceInner.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteInner.java @@ -7,51 +7,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.SitePropertiesFormat; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Device resource. */ +/** Site resource. */ @Fluent -public final class DeviceInner extends Resource { +public final class SiteInner extends Resource { /* - * Device properties. + * Site properties. */ @JsonProperty(value = "properties") - private DevicePropertiesFormat properties; + private SitePropertiesFormat properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of DeviceInner class. */ - public DeviceInner() { + /** Creates an instance of SiteInner class. */ + public SiteInner() { } /** - * Get the properties property: Device properties. + * Get the properties property: Site properties. * * @return the properties value. */ - public DevicePropertiesFormat properties() { + public SitePropertiesFormat properties() { return this.properties; } /** - * Set the properties property: Device properties. + * Set the properties property: Site properties. * * @param properties the properties value to set. - * @return the DeviceInner object itself. + * @return the SiteInner object itself. */ - public DeviceInner withProperties(DevicePropertiesFormat properties) { + public SiteInner withProperties(SitePropertiesFormat properties) { this.properties = properties; return this; } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -61,14 +61,14 @@ public SystemData systemData() { /** {@inheritDoc} */ @Override - public DeviceInner withLocation(String location) { + public SiteInner withLocation(String location) { super.withLocation(location); return this; } /** {@inheritDoc} */ @Override - public DeviceInner withTags(Map tags) { + public SiteInner withTags(Map tags) { super.withTags(tags); return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteNetworkServiceInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteNetworkServiceInner.java new file mode 100644 index 000000000000..d6379fd37bbe --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SiteNetworkServiceInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServicePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Site network service resource. */ +@Fluent +public final class SiteNetworkServiceInner extends Resource { + /* + * Site network service properties. + */ + @JsonProperty(value = "properties") + private SiteNetworkServicePropertiesFormat properties; + + /* + * The managed identity of the Site network service, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Sku of the site network service. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SiteNetworkServiceInner class. */ + public SiteNetworkServiceInner() { + } + + /** + * Get the properties property: Site network service properties. + * + * @return the properties value. + */ + public SiteNetworkServicePropertiesFormat properties() { + return this.properties; + } + + /** + * Set the properties property: Site network service properties. + * + * @param properties the properties value to set. + * @return the SiteNetworkServiceInner object itself. + */ + public SiteNetworkServiceInner withProperties(SiteNetworkServicePropertiesFormat properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed identity of the Site network service, if configured. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity of the Site network service, if configured. + * + * @param identity the identity value to set. + * @return the SiteNetworkServiceInner object itself. + */ + public SiteNetworkServiceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: Sku of the site network service. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the site network service. + * + * @param sku the sku value to set. + * @return the SiteNetworkServiceInner object itself. + */ + public SiteNetworkServiceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SiteNetworkServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SiteNetworkServiceInner 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(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.java deleted file mode 100644 index 15abd3e47556..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/SkuOverviewInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The network function sku overview. */ -@Fluent -public final class SkuOverviewInner { - /* - * The vendor sku name. - */ - @JsonProperty(value = "skuName") - private String skuName; - - /* - * The vendor sku type. - */ - @JsonProperty(value = "skuType") - private SkuType skuType; - - /** Creates an instance of SkuOverviewInner class. */ - public SkuOverviewInner() { - } - - /** - * Get the skuName property: The vendor sku name. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Set the skuName property: The vendor sku name. - * - * @param skuName the skuName value to set. - * @return the SkuOverviewInner object itself. - */ - public SkuOverviewInner withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - - /** - * Get the skuType property: The vendor sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.skuType; - } - - /** - * Set the skuType property: The vendor sku type. - * - * @param skuType the skuType value to set. - * @return the SkuOverviewInner object itself. - */ - public SkuOverviewInner withSkuType(SkuType skuType) { - this.skuType = skuType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorDetails.java deleted file mode 100644 index e09767245a0f..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorDetails.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network function vendor details. */ -@Fluent -public final class VendorDetails { - /* - * The network function vendor name. - */ - @JsonProperty(value = "vendorName") - private String vendorName; - - /* - * The network function sku list. - */ - @JsonProperty(value = "skuList") - private List skuList; - - /** Creates an instance of VendorDetails class. */ - public VendorDetails() { - } - - /** - * Get the vendorName property: The network function vendor name. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Set the vendorName property: The network function vendor name. - * - * @param vendorName the vendorName value to set. - * @return the VendorDetails object itself. - */ - public VendorDetails withVendorName(String vendorName) { - this.vendorName = vendorName; - return this; - } - - /** - * Get the skuList property: The network function sku list. - * - * @return the skuList value. - */ - public List skuList() { - return this.skuList; - } - - /** - * Set the skuList property: The network function sku list. - * - * @param skuList the skuList value to set. - * @return the VendorDetails object itself. - */ - public VendorDetails withSkuList(List skuList) { - this.skuList = skuList; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skuList() != null) { - skuList().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.java deleted file mode 100644 index 26127c4cd64e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SubResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Vendor resource. */ -@Immutable -public final class VendorInner extends ProxyResource { - /* - * Vendor properties. - */ - @JsonProperty(value = "properties") - private VendorPropertiesFormat innerProperties; - - /* - * The system meta data relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of VendorInner class. */ - public VendorInner() { - } - - /** - * Get the innerProperties property: Vendor properties. - * - * @return the innerProperties value. - */ - private VendorPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the provisioningState property: The provisioning state of the vendor resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the skus property: A list of IDs of the vendor skus offered by the vendor. - * - * @return the skus value. - */ - public List skus() { - return this.innerProperties() == null ? null : this.innerProperties().skus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.java deleted file mode 100644 index c8a0691b6024..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Vendor network function sub resource. */ -@Fluent -public final class VendorNetworkFunctionInner extends ProxyResource { - /* - * Network function details. - */ - @JsonProperty(value = "properties") - private VendorNetworkFunctionPropertiesFormat innerProperties; - - /* - * The system meta data relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of VendorNetworkFunctionInner class. */ - public VendorNetworkFunctionInner() { - } - - /** - * Get the innerProperties property: Network function details. - * - * @return the innerProperties value. - */ - private VendorNetworkFunctionPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the provisioningState property: The provisioning state of the vendor network function sub resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network - * function. - * - * @return the vendorProvisioningState value. - */ - public VendorProvisioningState vendorProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().vendorProvisioningState(); - } - - /** - * Set the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network - * function. - * - * @param vendorProvisioningState the vendorProvisioningState value to set. - * @return the VendorNetworkFunctionInner object itself. - */ - public VendorNetworkFunctionInner withVendorProvisioningState(VendorProvisioningState vendorProvisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorNetworkFunctionPropertiesFormat(); - } - this.innerProperties().withVendorProvisioningState(vendorProvisioningState); - return this; - } - - /** - * Get the skuName property: The name of the sku. Once set, it cannot be updated. - * - * @return the skuName value. - */ - public String skuName() { - return this.innerProperties() == null ? null : this.innerProperties().skuName(); - } - - /** - * Get the skuType property: The sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.innerProperties() == null ? null : this.innerProperties().skuType(); - } - - /** - * Get the networkFunctionVendorConfigurations property: An array of network function vendor configurations. - * - * @return the networkFunctionVendorConfigurations value. - */ - public List networkFunctionVendorConfigurations() { - return this.innerProperties() == null ? null : this.innerProperties().networkFunctionVendorConfigurations(); - } - - /** - * Set the networkFunctionVendorConfigurations property: An array of network function vendor configurations. - * - * @param networkFunctionVendorConfigurations the networkFunctionVendorConfigurations value to set. - * @return the VendorNetworkFunctionInner object itself. - */ - public VendorNetworkFunctionInner withNetworkFunctionVendorConfigurations( - List networkFunctionVendorConfigurations) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorNetworkFunctionPropertiesFormat(); - } - this.innerProperties().withNetworkFunctionVendorConfigurations(networkFunctionVendorConfigurations); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionPropertiesFormat.java deleted file mode 100644 index 100bd4ce8d47..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorNetworkFunctionPropertiesFormat.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Vendor network function properties. */ -@Fluent -public final class VendorNetworkFunctionPropertiesFormat { - /* - * The provisioning state of the vendor network function sub resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The vendor controlled provisioning state of the vendor network function. - */ - @JsonProperty(value = "vendorProvisioningState") - private VendorProvisioningState vendorProvisioningState; - - /* - * The name of the sku. Once set, it cannot be updated. - */ - @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) - private String skuName; - - /* - * The sku type. - */ - @JsonProperty(value = "skuType", access = JsonProperty.Access.WRITE_ONLY) - private SkuType skuType; - - /* - * An array of network function vendor configurations. - */ - @JsonProperty(value = "networkFunctionVendorConfigurations") - private List networkFunctionVendorConfigurations; - - /** Creates an instance of VendorNetworkFunctionPropertiesFormat class. */ - public VendorNetworkFunctionPropertiesFormat() { - } - - /** - * Get the provisioningState property: The provisioning state of the vendor network function sub resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network - * function. - * - * @return the vendorProvisioningState value. - */ - public VendorProvisioningState vendorProvisioningState() { - return this.vendorProvisioningState; - } - - /** - * Set the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network - * function. - * - * @param vendorProvisioningState the vendorProvisioningState value to set. - * @return the VendorNetworkFunctionPropertiesFormat object itself. - */ - public VendorNetworkFunctionPropertiesFormat withVendorProvisioningState( - VendorProvisioningState vendorProvisioningState) { - this.vendorProvisioningState = vendorProvisioningState; - return this; - } - - /** - * Get the skuName property: The name of the sku. Once set, it cannot be updated. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the skuType property: The sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.skuType; - } - - /** - * Get the networkFunctionVendorConfigurations property: An array of network function vendor configurations. - * - * @return the networkFunctionVendorConfigurations value. - */ - public List networkFunctionVendorConfigurations() { - return this.networkFunctionVendorConfigurations; - } - - /** - * Set the networkFunctionVendorConfigurations property: An array of network function vendor configurations. - * - * @param networkFunctionVendorConfigurations the networkFunctionVendorConfigurations value to set. - * @return the VendorNetworkFunctionPropertiesFormat object itself. - */ - public VendorNetworkFunctionPropertiesFormat withNetworkFunctionVendorConfigurations( - List networkFunctionVendorConfigurations) { - this.networkFunctionVendorConfigurations = networkFunctionVendorConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkFunctionVendorConfigurations() != null) { - networkFunctionVendorConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorPropertiesFormat.java deleted file mode 100644 index ef07b8a48f25..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorPropertiesFormat.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Vendor properties. */ -@Immutable -public final class VendorPropertiesFormat { - /* - * The provisioning state of the vendor resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * A list of IDs of the vendor skus offered by the vendor. - */ - @JsonProperty(value = "skus", access = JsonProperty.Access.WRITE_ONLY) - private List skus; - - /** Creates an instance of VendorPropertiesFormat class. */ - public VendorPropertiesFormat() { - } - - /** - * Get the provisioningState property: The provisioning state of the vendor resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the skus property: A list of IDs of the vendor skus offered by the vendor. - * - * @return the skus value. - */ - public List skus() { - return this.skus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java deleted file mode 100644 index e026233bfcfd..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuInner.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sku sub resource. */ -@Fluent -public final class VendorSkuInner extends ProxyResource { - /* - * Vendor sku details. - */ - @JsonProperty(value = "properties") - private VendorSkuPropertiesFormat innerProperties; - - /* - * The system meta data relating to this resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of VendorSkuInner class. */ - public VendorSkuInner() { - } - - /** - * Get the innerProperties property: Vendor sku details. - * - * @return the innerProperties value. - */ - private VendorSkuPropertiesFormat innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the provisioningState property: The provisioning state of the vendor sku sub resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the skuType property: The sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.innerProperties() == null ? null : this.innerProperties().skuType(); - } - - /** - * Set the skuType property: The sku type. - * - * @param skuType the skuType value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withSkuType(SkuType skuType) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withSkuType(skuType); - return this; - } - - /** - * Get the deploymentMode property: The sku deployment mode. - * - * @return the deploymentMode value. - */ - public SkuDeploymentMode deploymentMode() { - return this.innerProperties() == null ? null : this.innerProperties().deploymentMode(); - } - - /** - * Set the deploymentMode property: The sku deployment mode. - * - * @param deploymentMode the deploymentMode value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withDeploymentMode(SkuDeploymentMode deploymentMode) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withDeploymentMode(deploymentMode); - return this; - } - - /** - * Get the networkFunctionType property: The network function type. - * - * @return the networkFunctionType value. - */ - public NetworkFunctionType networkFunctionType() { - return this.innerProperties() == null ? null : this.innerProperties().networkFunctionType(); - } - - /** - * Set the networkFunctionType property: The network function type. - * - * @param networkFunctionType the networkFunctionType value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withNetworkFunctionType(NetworkFunctionType networkFunctionType) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withNetworkFunctionType(networkFunctionType); - return this; - } - - /** - * Get the preview property: Indicates if the vendor sku is in preview mode. - * - * @return the preview value. - */ - public Boolean preview() { - return this.innerProperties() == null ? null : this.innerProperties().preview(); - } - - /** - * Set the preview property: Indicates if the vendor sku is in preview mode. - * - * @param preview the preview value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withPreview(Boolean preview) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withPreview(preview); - return this; - } - - /** - * Get the managedApplicationParameters property: The parameters for the managed application to be supplied by the - * vendor. - * - * @return the managedApplicationParameters value. - */ - public Object managedApplicationParameters() { - return this.innerProperties() == null ? null : this.innerProperties().managedApplicationParameters(); - } - - /** - * Set the managedApplicationParameters property: The parameters for the managed application to be supplied by the - * vendor. - * - * @param managedApplicationParameters the managedApplicationParameters value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withManagedApplicationParameters(Object managedApplicationParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withManagedApplicationParameters(managedApplicationParameters); - return this; - } - - /** - * Get the managedApplicationTemplate property: The template for the managed application deployment. - * - * @return the managedApplicationTemplate value. - */ - public Object managedApplicationTemplate() { - return this.innerProperties() == null ? null : this.innerProperties().managedApplicationTemplate(); - } - - /** - * Set the managedApplicationTemplate property: The template for the managed application deployment. - * - * @param managedApplicationTemplate the managedApplicationTemplate value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withManagedApplicationTemplate(Object managedApplicationTemplate) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withManagedApplicationTemplate(managedApplicationTemplate); - return this; - } - - /** - * Get the networkFunctionTemplate property: The template definition of the network function. - * - * @return the networkFunctionTemplate value. - */ - public NetworkFunctionTemplate networkFunctionTemplate() { - return this.innerProperties() == null ? null : this.innerProperties().networkFunctionTemplate(); - } - - /** - * Set the networkFunctionTemplate property: The template definition of the network function. - * - * @param networkFunctionTemplate the networkFunctionTemplate value to set. - * @return the VendorSkuInner object itself. - */ - public VendorSkuInner withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate) { - if (this.innerProperties() == null) { - this.innerProperties = new VendorSkuPropertiesFormat(); - } - this.innerProperties().withNetworkFunctionTemplate(networkFunctionTemplate); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuPropertiesFormat.java deleted file mode 100644 index 52eca145f3e0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/models/VendorSkuPropertiesFormat.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Sku properties. */ -@Fluent -public final class VendorSkuPropertiesFormat { - /* - * The provisioning state of the vendor sku sub resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The sku type. - */ - @JsonProperty(value = "skuType") - private SkuType skuType; - - /* - * The sku deployment mode. - */ - @JsonProperty(value = "deploymentMode") - private SkuDeploymentMode deploymentMode; - - /* - * The network function type. - */ - @JsonProperty(value = "networkFunctionType") - private NetworkFunctionType networkFunctionType; - - /* - * Indicates if the vendor sku is in preview mode. - */ - @JsonProperty(value = "preview") - private Boolean preview; - - /* - * The parameters for the managed application to be supplied by the vendor. - */ - @JsonProperty(value = "managedApplicationParameters") - private Object managedApplicationParameters; - - /* - * The template for the managed application deployment. - */ - @JsonProperty(value = "managedApplicationTemplate") - private Object managedApplicationTemplate; - - /* - * The template definition of the network function. - */ - @JsonProperty(value = "networkFunctionTemplate") - private NetworkFunctionTemplate networkFunctionTemplate; - - /** Creates an instance of VendorSkuPropertiesFormat class. */ - public VendorSkuPropertiesFormat() { - } - - /** - * Get the provisioningState property: The provisioning state of the vendor sku sub resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the skuType property: The sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.skuType; - } - - /** - * Set the skuType property: The sku type. - * - * @param skuType the skuType value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withSkuType(SkuType skuType) { - this.skuType = skuType; - return this; - } - - /** - * Get the deploymentMode property: The sku deployment mode. - * - * @return the deploymentMode value. - */ - public SkuDeploymentMode deploymentMode() { - return this.deploymentMode; - } - - /** - * Set the deploymentMode property: The sku deployment mode. - * - * @param deploymentMode the deploymentMode value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withDeploymentMode(SkuDeploymentMode deploymentMode) { - this.deploymentMode = deploymentMode; - return this; - } - - /** - * Get the networkFunctionType property: The network function type. - * - * @return the networkFunctionType value. - */ - public NetworkFunctionType networkFunctionType() { - return this.networkFunctionType; - } - - /** - * Set the networkFunctionType property: The network function type. - * - * @param networkFunctionType the networkFunctionType value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withNetworkFunctionType(NetworkFunctionType networkFunctionType) { - this.networkFunctionType = networkFunctionType; - return this; - } - - /** - * Get the preview property: Indicates if the vendor sku is in preview mode. - * - * @return the preview value. - */ - public Boolean preview() { - return this.preview; - } - - /** - * Set the preview property: Indicates if the vendor sku is in preview mode. - * - * @param preview the preview value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withPreview(Boolean preview) { - this.preview = preview; - return this; - } - - /** - * Get the managedApplicationParameters property: The parameters for the managed application to be supplied by the - * vendor. - * - * @return the managedApplicationParameters value. - */ - public Object managedApplicationParameters() { - return this.managedApplicationParameters; - } - - /** - * Set the managedApplicationParameters property: The parameters for the managed application to be supplied by the - * vendor. - * - * @param managedApplicationParameters the managedApplicationParameters value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withManagedApplicationParameters(Object managedApplicationParameters) { - this.managedApplicationParameters = managedApplicationParameters; - return this; - } - - /** - * Get the managedApplicationTemplate property: The template for the managed application deployment. - * - * @return the managedApplicationTemplate value. - */ - public Object managedApplicationTemplate() { - return this.managedApplicationTemplate; - } - - /** - * Set the managedApplicationTemplate property: The template for the managed application deployment. - * - * @param managedApplicationTemplate the managedApplicationTemplate value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withManagedApplicationTemplate(Object managedApplicationTemplate) { - this.managedApplicationTemplate = managedApplicationTemplate; - return this; - } - - /** - * Get the networkFunctionTemplate property: The template definition of the network function. - * - * @return the networkFunctionTemplate value. - */ - public NetworkFunctionTemplate networkFunctionTemplate() { - return this.networkFunctionTemplate; - } - - /** - * Set the networkFunctionTemplate property: The template definition of the network function. - * - * @param networkFunctionTemplate the networkFunctionTemplate value to set. - * @return the VendorSkuPropertiesFormat object itself. - */ - public VendorSkuPropertiesFormat withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate) { - this.networkFunctionTemplate = networkFunctionTemplate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkFunctionTemplate() != null) { - networkFunctionTemplate().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactAccessCredentialImpl.java similarity index 55% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactAccessCredentialImpl.java index 38444eae51e5..6ac055c777a9 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceRegistrationKeyImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactAccessCredentialImpl.java @@ -4,26 +4,22 @@ package com.azure.resourcemanager.hybridnetwork.implementation; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; -import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactAccessCredential; -public final class DeviceRegistrationKeyImpl implements DeviceRegistrationKey { - private DeviceRegistrationKeyInner innerObject; +public final class ArtifactAccessCredentialImpl implements ArtifactAccessCredential { + private ArtifactAccessCredentialInner innerObject; private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - DeviceRegistrationKeyImpl( - DeviceRegistrationKeyInner innerObject, + ArtifactAccessCredentialImpl( + ArtifactAccessCredentialInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String registrationKey() { - return this.innerModel().registrationKey(); - } - - public DeviceRegistrationKeyInner innerModel() { + public ArtifactAccessCredentialInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestImpl.java new file mode 100644 index 000000000000..176b77fd98e4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestImpl.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ArtifactManifestInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactAccessCredential; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifest; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ArtifactManifestImpl + implements ArtifactManifest, ArtifactManifest.Definition, ArtifactManifest.Update { + private ArtifactManifestInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 ArtifactManifestPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 ArtifactManifestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String artifactStoreName; + + private String artifactManifestName; + + private TagsObject updateParameters; + + public ArtifactManifestImpl withExistingArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + this.artifactStoreName = artifactStoreName; + return this; + } + + public ArtifactManifest create() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .createOrUpdate( + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.innerModel(), + Context.NONE); + return this; + } + + public ArtifactManifest create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .createOrUpdate( + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.innerModel(), + context); + return this; + } + + ArtifactManifestImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new ArtifactManifestInner(); + this.serviceManager = serviceManager; + this.artifactManifestName = name; + } + + public ArtifactManifestImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ArtifactManifest apply() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .updateWithResponse( + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public ArtifactManifest apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .updateWithResponse( + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + updateParameters, + context) + .getValue(); + return this; + } + + ArtifactManifestImpl( + ArtifactManifestInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.artifactStoreName = Utils.getValueFromIdByName(innerObject.id(), "artifactStores"); + this.artifactManifestName = Utils.getValueFromIdByName(innerObject.id(), "artifactManifests"); + } + + public ArtifactManifest refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .getWithResponse( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, Context.NONE) + .getValue(); + return this; + } + + public ArtifactManifest refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactManifests() + .getWithResponse(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context) + .getValue(); + return this; + } + + public Response listCredentialWithResponse(Context context) { + return serviceManager + .artifactManifests() + .listCredentialWithResponse( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + } + + public ArtifactAccessCredential listCredential() { + return serviceManager + .artifactManifests() + .listCredential(resourceGroupName, publisherName, artifactStoreName, artifactManifestName); + } + + public ArtifactManifestUpdateState updateState(ArtifactManifestUpdateStateInner parameters) { + return serviceManager + .artifactManifests() + .updateState(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters); + } + + public ArtifactManifestUpdateState updateState(ArtifactManifestUpdateStateInner parameters, Context context) { + return serviceManager + .artifactManifests() + .updateState( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context); + } + + public ArtifactManifestImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ArtifactManifestImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ArtifactManifestImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ArtifactManifestImpl withProperties(ArtifactManifestPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestUpdateStateImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestUpdateStateImpl.java new file mode 100644 index 000000000000..eb0cabce10f0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestUpdateStateImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestState; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestUpdateState; + +public final class ArtifactManifestUpdateStateImpl implements ArtifactManifestUpdateState { + private ArtifactManifestUpdateStateInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + ArtifactManifestUpdateStateImpl( + ArtifactManifestUpdateStateInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ArtifactManifestState artifactManifestState() { + return this.innerModel().artifactManifestState(); + } + + public ArtifactManifestUpdateStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsClientImpl.java new file mode 100644 index 000000000000..2904e1996c9d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsClientImpl.java @@ -0,0 +1,2106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.ArtifactManifestsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 ArtifactManifestsClient. */ +public final class ArtifactManifestsClientImpl implements ArtifactManifestsClient { + /** The proxy service used to perform REST calls. */ + private final ArtifactManifestsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of ArtifactManifestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArtifactManifestsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(ArtifactManifestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientArtifactManifests to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface ArtifactManifestsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArtifactStore( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArtifactManifestInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCredential( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @PathParam("artifactManifestName") String artifactManifestName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArtifactManifestUpdateStateInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArtifactStoreNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArtifactStoreSinglePageAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required 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 + .listByArtifactStore( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + 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())); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArtifactStoreSinglePageAsync( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByArtifactStore( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + 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)); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArtifactStoreAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + return new PagedFlux<>( + () -> listByArtifactStoreSinglePageAsync(resourceGroupName, publisherName, artifactStoreName), + nextLink -> listByArtifactStoreNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArtifactStoreAsync( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + return new PagedFlux<>( + () -> listByArtifactStoreSinglePageAsync(resourceGroupName, publisherName, artifactStoreName, context), + nextLink -> listByArtifactStoreNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName) { + return new PagedIterable<>(listByArtifactStoreAsync(resourceGroupName, publisherName, artifactStoreName)); + } + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + return new PagedIterable<>( + listByArtifactStoreAsync(resourceGroupName, publisherName, artifactStoreName, context)); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName, String artifactManifestName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName, String artifactManifestName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String artifactStoreName, String artifactManifestName) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName) + .getSyncPoller(); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String artifactStoreName, String artifactManifestName) { + return beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String artifactStoreName, String artifactManifestName) { + deleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName).block(); + } + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + deleteAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context).block(); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactManifestInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArtifactManifestInner.class, + ArtifactManifestInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactManifestInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ArtifactManifestInner.class, ArtifactManifestInner.class, context); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactManifestInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactManifestInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters) { + return createOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .block(); + } + + /** + * Creates or updates a artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .block(); + } + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + return getWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + return getWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context) + .block(); + } + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestInner get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + return getWithResponse(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, Context.NONE) + .getValue(); + } + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters) { + return updateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .block(); + } + + /** + * Updates a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to the create or update artifact manifest operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact manifest properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestInner update( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + TagsObject parameters) { + return updateWithResponse( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, Context.NONE) + .getValue(); + } + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required 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 + .listCredential( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCredential( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCredentialAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + return listCredentialWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCredentialWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + return listCredentialWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context) + .block(); + } + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactAccessCredentialInner listCredential( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + return listCredentialWithResponse( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, Context.NONE) + .getValue(); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactManifestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactManifestName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactManifestUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArtifactManifestUpdateStateInner.class, + ArtifactManifestUpdateStateInner.class, + this.client.getContext()); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactManifestUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArtifactManifestUpdateStateInner.class, + ArtifactManifestUpdateStateInner.class, + context); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactManifestUpdateStateInner> beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + return this + .beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .getSyncPoller(); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactManifestUpdateStateInner> beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + return this + .beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .getSyncPoller(); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + return beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + return beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + return updateStateAsync(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters) + .block(); + } + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactManifestUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + return updateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of artifact manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArtifactStoreNextSinglePageAsync(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.listByArtifactStoreNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of artifact manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArtifactStoreNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByArtifactStoreNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsImpl.java new file mode 100644 index 000000000000..31c5cb094f35 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactManifestsImpl.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ArtifactManifestsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactAccessCredential; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifest; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifests; + +public final class ArtifactManifestsImpl implements ArtifactManifests { + private static final ClientLogger LOGGER = new ClientLogger(ArtifactManifestsImpl.class); + + private final ArtifactManifestsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ArtifactManifestsImpl( + ArtifactManifestsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName) { + PagedIterable inner = + this.serviceClient().listByArtifactStore(resourceGroupName, publisherName, artifactStoreName); + return Utils.mapPage(inner, inner1 -> new ArtifactManifestImpl(inner1, this.manager())); + } + + public PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + PagedIterable inner = + this.serviceClient().listByArtifactStore(resourceGroupName, publisherName, artifactStoreName, context); + return Utils.mapPage(inner, inner1 -> new ArtifactManifestImpl(inner1, this.manager())); + } + + public void delete( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + this.serviceClient().delete(resourceGroupName, publisherName, artifactStoreName, artifactManifestName); + } + + public void delete( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + } + + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArtifactManifestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArtifactManifest get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + ArtifactManifestInner inner = + this.serviceClient().get(resourceGroupName, publisherName, artifactStoreName, artifactManifestName); + if (inner != null) { + return new ArtifactManifestImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listCredentialWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context) { + Response inner = + this + .serviceClient() + .listCredentialWithResponse( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArtifactAccessCredentialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArtifactAccessCredential listCredential( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName) { + ArtifactAccessCredentialInner inner = + this + .serviceClient() + .listCredential(resourceGroupName, publisherName, artifactStoreName, artifactManifestName); + if (inner != null) { + return new ArtifactAccessCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArtifactManifestUpdateState updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters) { + ArtifactManifestUpdateStateInner inner = + this + .serviceClient() + .updateState(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters); + if (inner != null) { + return new ArtifactManifestUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArtifactManifestUpdateState updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context) { + ArtifactManifestUpdateStateInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, publisherName, artifactStoreName, artifactManifestName, parameters, context); + if (inner != null) { + return new ArtifactManifestUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArtifactManifest getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + String artifactManifestName = Utils.getValueFromIdByName(id, "artifactManifests"); + if (artifactManifestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'artifactManifests'.", id))); + } + return this + .getWithResponse(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + String artifactManifestName = Utils.getValueFromIdByName(id, "artifactManifests"); + if (artifactManifestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'artifactManifests'.", id))); + } + return this.getWithResponse(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + String artifactManifestName = Utils.getValueFromIdByName(id, "artifactManifests"); + if (artifactManifestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'artifactManifests'.", id))); + } + this.delete(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + String artifactManifestName = Utils.getValueFromIdByName(id, "artifactManifests"); + if (artifactManifestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'artifactManifests'.", id))); + } + this.delete(resourceGroupName, publisherName, artifactStoreName, artifactManifestName, context); + } + + private ArtifactManifestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public ArtifactManifestImpl define(String name) { + return new ArtifactManifestImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoreImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoreImpl.java new file mode 100644 index 000000000000..95d1b52e99fd --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoreImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStore; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ArtifactStoreImpl implements ArtifactStore, ArtifactStore.Definition, ArtifactStore.Update { + private ArtifactStoreInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 ArtifactStorePropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 ArtifactStoreInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String artifactStoreName; + + private TagsObject updateParameters; + + public ArtifactStoreImpl withExistingPublisher(String resourceGroupName, String publisherName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + return this; + } + + public ArtifactStore create() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .createOrUpdate(resourceGroupName, publisherName, artifactStoreName, this.innerModel(), Context.NONE); + return this; + } + + public ArtifactStore create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .createOrUpdate(resourceGroupName, publisherName, artifactStoreName, this.innerModel(), context); + return this; + } + + ArtifactStoreImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new ArtifactStoreInner(); + this.serviceManager = serviceManager; + this.artifactStoreName = name; + } + + public ArtifactStoreImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ArtifactStore apply() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .updateWithResponse(resourceGroupName, publisherName, artifactStoreName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ArtifactStore apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .updateWithResponse(resourceGroupName, publisherName, artifactStoreName, updateParameters, context) + .getValue(); + return this; + } + + ArtifactStoreImpl( + ArtifactStoreInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.artifactStoreName = Utils.getValueFromIdByName(innerObject.id(), "artifactStores"); + } + + public ArtifactStore refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .getWithResponse(resourceGroupName, publisherName, artifactStoreName, Context.NONE) + .getValue(); + return this; + } + + public ArtifactStore refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArtifactStores() + .getWithResponse(resourceGroupName, publisherName, artifactStoreName, context) + .getValue(); + return this; + } + + public ArtifactStoreImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ArtifactStoreImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ArtifactStoreImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ArtifactStoreImpl withProperties(ArtifactStorePropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresClientImpl.java new file mode 100644 index 000000000000..b83d76811326 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresClientImpl.java @@ -0,0 +1,1323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.ArtifactStoresClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStoreListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 ArtifactStoresClient. */ +public final class ArtifactStoresClientImpl implements ArtifactStoresClient { + /** The proxy service used to perform REST calls. */ + private final ArtifactStoresService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of ArtifactStoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArtifactStoresClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(ArtifactStoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientArtifactStores to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface ArtifactStoresService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArtifactStoreInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required 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 + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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())); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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)); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync(String resourceGroupName, String publisherName) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher(String resourceGroupName, String publisherName) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName)); + } + + /** + * Gets information of the ArtifactStores under publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName, context)); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, artifactStoreName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String artifactStoreName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String artifactStoreName) { + return this.beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName).getSyncPoller(); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String artifactStoreName, Context context) { + return this.beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, context).getSyncPoller(); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String artifactStoreName) { + return beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String artifactStoreName, Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, artifactStoreName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String artifactStoreName) { + deleteAsync(resourceGroupName, publisherName, artifactStoreName).block(); + } + + /** + * Deletes the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String artifactStoreName, Context context) { + deleteAsync(resourceGroupName, publisherName, artifactStoreName, context).block(); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactStoreInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArtifactStoreInner.class, + ArtifactStoreInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArtifactStoreInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ArtifactStoreInner.class, ArtifactStoreInner.class, context); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactStoreInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of artifact store properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArtifactStoreInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactStoreInner createOrUpdate( + String resourceGroupName, String publisherName, String artifactStoreName, ArtifactStoreInner parameters) { + return createOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters).block(); + } + + /** + * Creates or updates a artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactStoreInner createOrUpdate( + String resourceGroupName, + String publisherName, + String artifactStoreName, + ArtifactStoreInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, publisherName, artifactStoreName, parameters, context).block(); + } + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + return getWithResponseAsync(resourceGroupName, publisherName, artifactStoreName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + return getWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, context).block(); + } + + /** + * Gets information about the specified artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactStoreInner get(String resourceGroupName, String publisherName, String artifactStoreName) { + return getWithResponse(resourceGroupName, publisherName, artifactStoreName, Context.NONE).getValue(); + } + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String publisherName, String artifactStoreName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String publisherName, String artifactStoreName, TagsObject parameters) { + return updateWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, publisherName, artifactStoreName, parameters, context) + .block(); + } + + /** + * Update artifact store resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param parameters Parameters supplied to the create or update application group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact store properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactStoreInner update( + String resourceGroupName, String publisherName, String artifactStoreName, TagsObject parameters) { + return updateWithResponse(resourceGroupName, publisherName, artifactStoreName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of artifact stores along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of artifact stores along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresImpl.java new file mode 100644 index 000000000000..de2047465a1a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ArtifactStoresImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ArtifactStoresClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStore; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStores; + +public final class ArtifactStoresImpl implements ArtifactStores { + private static final ClientLogger LOGGER = new ClientLogger(ArtifactStoresImpl.class); + + private final ArtifactStoresClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ArtifactStoresImpl( + ArtifactStoresClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName); + return Utils.mapPage(inner, inner1 -> new ArtifactStoreImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName, context); + return Utils.mapPage(inner, inner1 -> new ArtifactStoreImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String publisherName, String artifactStoreName) { + this.serviceClient().delete(resourceGroupName, publisherName, artifactStoreName); + } + + public void delete(String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, artifactStoreName, context); + } + + public Response getWithResponse( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, publisherName, artifactStoreName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArtifactStoreImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArtifactStore get(String resourceGroupName, String publisherName, String artifactStoreName) { + ArtifactStoreInner inner = this.serviceClient().get(resourceGroupName, publisherName, artifactStoreName); + if (inner != null) { + return new ArtifactStoreImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArtifactStore getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + return this.getWithResponse(resourceGroupName, publisherName, artifactStoreName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + return this.getWithResponse(resourceGroupName, publisherName, artifactStoreName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + this.delete(resourceGroupName, publisherName, artifactStoreName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String artifactStoreName = Utils.getValueFromIdByName(id, "artifactStores"); + if (artifactStoreName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'artifactStores'.", id))); + } + this.delete(resourceGroupName, publisherName, artifactStoreName, context); + } + + private ArtifactStoresClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public ArtifactStoreImpl define(String name) { + return new ArtifactStoreImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentImpl.java similarity index 54% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentImpl.java index 73740c62f82b..a23ce993dc5b 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstanceImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentImpl.java @@ -5,47 +5,42 @@ package com.azure.resourcemanager.hybridnetwork.implementation; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.RoleInstance; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; +import com.azure.resourcemanager.hybridnetwork.models.Component; +import com.azure.resourcemanager.hybridnetwork.models.ComponentProperties; -public final class RoleInstanceImpl implements RoleInstance { - private RoleInstanceInner innerObject; +public final class ComponentImpl implements Component { + private ComponentInner innerObject; private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - RoleInstanceImpl( - RoleInstanceInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + ComponentImpl( + ComponentInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); - } - public String id() { return this.innerModel().id(); } - public String type() { - return this.innerModel().type(); + public String name() { + return this.innerModel().name(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public String type() { + return this.innerModel().type(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public ComponentProperties properties() { + return this.innerModel().properties(); } - public OperationalState operationalState() { - return this.innerModel().operationalState(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public RoleInstanceInner innerModel() { + public ComponentInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsClientImpl.java similarity index 50% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsClientImpl.java index f15eb3cacaac..3b993589f89b 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusClientImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsClientImpl.java @@ -25,50 +25,47 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuDetails; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuListResult; +import com.azure.resourcemanager.hybridnetwork.fluent.ComponentsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; +import com.azure.resourcemanager.hybridnetwork.models.ComponentListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorSkusClient. */ -public final class NetworkFunctionVendorSkusClientImpl implements NetworkFunctionVendorSkusClient { +/** An instance of this class provides access to all the operations defined in ComponentsClient. */ +public final class ComponentsClientImpl implements ComponentsClient { /** The proxy service used to perform REST calls. */ - private final NetworkFunctionVendorSkusService service; + private final ComponentsService service; /** The service client containing this operation class. */ private final HybridNetworkManagementClientImpl client; /** - * Initializes an instance of NetworkFunctionVendorSkusClientImpl. + * Initializes an instance of ComponentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - NetworkFunctionVendorSkusClientImpl(HybridNetworkManagementClientImpl client) { + ComponentsClientImpl(HybridNetworkManagementClientImpl client) { this.service = - RestProxy - .create( - NetworkFunctionVendorSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy.create(ComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionVendorSkus to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for HybridNetworkManagementClientComponents to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "HybridNetworkManagem") - private interface NetworkFunctionVendorSkusService { + public interface ComponentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}" - + "/vendorSkus") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVendor( + Mono> get( @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, @@ -76,16 +73,15 @@ Mono> listByVendor( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors/{vendorName}" - + "/vendorSkus/{vendorSkuName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySku( + Mono> listByNetworkFunction( @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("vendorSkuName") String vendorSkuName, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkFunctionName") String networkFunctionName, @HeaderParam("Accept") String accept, Context context); @@ -93,17 +89,7 @@ Mono> listBySku( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVendorNext( - @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> listBySkuNext( + Mono> listByNetworkFunctionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -111,25 +97,36 @@ Mono> listBySkuNext( } /** - * Lists all network function vendor sku details in a vendor. + * Gets information about the specified application instance resource. * - * @param vendorName The name of the network function vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return information about the specified application instance resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVendorSinglePageAsync(String vendorName) { + private Mono> getWithResponseAsync( + String resourceGroupName, String networkFunctionName, String componentName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -142,46 +139,50 @@ private Mono> listByVendorSinglePageAsync(String .withContext( context -> service - .listByVendor( + .get( this.client.getEndpoint(), - vendorName, + resourceGroupName, + networkFunctionName, + componentName, 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())); } /** - * Lists all network function vendor sku details in a vendor. + * Gets information about the specified application instance resource. * - * @param vendorName The name of the network function vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return information about the specified application instance resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVendorSinglePageAsync(String vendorName, Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String networkFunctionName, String componentName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -192,110 +193,91 @@ private Mono> listByVendorSinglePageAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByVendor( + .get( this.client.getEndpoint(), - vendorName, + resourceGroupName, + networkFunctionName, + componentName, 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)); + context); } /** - * Lists all network function vendor sku details in a vendor. + * Gets information about the specified application instance resource. * - * @param vendorName The name of the network function vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus as paginated response with {@link PagedFlux}. + * @return information about the specified application instance resource on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVendorAsync(String vendorName) { - return new PagedFlux<>( - () -> listByVendorSinglePageAsync(vendorName), nextLink -> listByVendorNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkFunctionName, String componentName) { + return getWithResponseAsync(resourceGroupName, networkFunctionName, componentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all network function vendor sku details in a vendor. + * Gets information about the specified application instance resource. * - * @param vendorName The name of the network function vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVendorAsync(String vendorName, Context context) { - return new PagedFlux<>( - () -> listByVendorSinglePageAsync(vendorName, context), - nextLink -> listByVendorNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all network function vendor sku details in a vendor. - * - * @param vendorName The name of the network function vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. + * @return information about the specified application instance resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVendor(String vendorName) { - return new PagedIterable<>(listByVendorAsync(vendorName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkFunctionName, String componentName, Context context) { + return getWithResponseAsync(resourceGroupName, networkFunctionName, componentName, context).block(); } /** - * Lists all network function vendor sku details in a vendor. + * Gets information about the specified application instance resource. * - * @param vendorName The name of the network function vendor. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. + * @return information about the specified application instance resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVendor(String vendorName, Context context) { - return new PagedIterable<>(listByVendorAsync(vendorName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentInner get(String resourceGroupName, String networkFunctionName, String componentName) { + return getWithResponse(resourceGroupName, networkFunctionName, componentName, Context.NONE).getValue(); } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response for list component API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuSinglePageAsync( - String vendorName, String vendorSkuName) { + private Mono> listByNetworkFunctionSinglePageAsync( + String resourceGroupName, String networkFunctionName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (vendorSkuName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorSkuName is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -303,20 +285,24 @@ private Mono> listBySkuSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listBySku( + .listByNetworkFunction( this.client.getEndpoint(), - vendorName, - vendorSkuName, + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), + networkFunctionName, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -329,31 +315,29 @@ private Mono> listBySkuSingleP } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return response for list component API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuSinglePageAsync( - String vendorName, String vendorSkuName, Context context) { + private Mono> listByNetworkFunctionSinglePageAsync( + String resourceGroupName, String networkFunctionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (vendorSkuName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorSkuName is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -361,15 +345,19 @@ private Mono> listBySkuSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySku( + .listByNetworkFunction( this.client.getEndpoint(), - vendorName, - vendorSkuName, + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), + networkFunctionName, accept, context) .map( @@ -384,71 +372,71 @@ private Mono> listBySkuSingleP } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedFlux}. + * @return response for list component API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySkuAsync(String vendorName, String vendorSkuName) { + private PagedFlux listByNetworkFunctionAsync(String resourceGroupName, String networkFunctionName) { return new PagedFlux<>( - () -> listBySkuSinglePageAsync(vendorName, vendorSkuName), - nextLink -> listBySkuNextSinglePageAsync(nextLink)); + () -> listByNetworkFunctionSinglePageAsync(resourceGroupName, networkFunctionName), + nextLink -> listByNetworkFunctionNextSinglePageAsync(nextLink)); } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedFlux}. + * @return response for list component API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySkuAsync( - String vendorName, String vendorSkuName, Context context) { + private PagedFlux listByNetworkFunctionAsync( + String resourceGroupName, String networkFunctionName, Context context) { return new PagedFlux<>( - () -> listBySkuSinglePageAsync(vendorName, vendorSkuName, context), - nextLink -> listBySkuNextSinglePageAsync(nextLink, context)); + () -> listByNetworkFunctionSinglePageAsync(resourceGroupName, networkFunctionName, context), + nextLink -> listByNetworkFunctionNextSinglePageAsync(nextLink, context)); } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. + * @return response for list component API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySku(String vendorName, String vendorSkuName) { - return new PagedIterable<>(listBySkuAsync(vendorName, vendorSkuName)); + public PagedIterable listByNetworkFunction(String resourceGroupName, String networkFunctionName) { + return new PagedIterable<>(listByNetworkFunctionAsync(resourceGroupName, networkFunctionName)); } /** - * Lists information about network function vendor sku details. + * Lists all the component resources in a network function. * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. + * @return response for list component API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySku( - String vendorName, String vendorSkuName, Context context) { - return new PagedIterable<>(listBySkuAsync(vendorName, vendorSkuName, context)); + public PagedIterable listByNetworkFunction( + String resourceGroupName, String networkFunctionName, Context context) { + return new PagedIterable<>(listByNetworkFunctionAsync(resourceGroupName, networkFunctionName, context)); } /** @@ -459,11 +447,11 @@ public PagedIterable listBySku( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus along with {@link PagedResponse} on successful completion of + * @return response for list component API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVendorNextSinglePageAsync(String nextLink) { + private Mono> listByNetworkFunctionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -475,8 +463,9 @@ private Mono> listByVendorNextSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByVendorNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext( + context -> service.listByNetworkFunctionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -497,86 +486,11 @@ private Mono> listByVendorNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 available network function skus along with {@link PagedResponse} on successful completion of + * @return response for list component API service call along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVendorNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVendorNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuNextSinglePageAsync(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.listBySkuNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySkuNextSinglePageAsync( + private Mono> listByNetworkFunctionNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -590,7 +504,7 @@ private Mono> listBySkuNextSin final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySkuNext(nextLink, this.client.getEndpoint(), accept, context) + .listByNetworkFunctionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsImpl.java new file mode 100644 index 000000000000..d0354f830bca --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ComponentsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ComponentsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; +import com.azure.resourcemanager.hybridnetwork.models.Component; +import com.azure.resourcemanager.hybridnetwork.models.Components; + +public final class ComponentsImpl implements Components { + private static final ClientLogger LOGGER = new ClientLogger(ComponentsImpl.class); + + private final ComponentsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ComponentsImpl( + ComponentsClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String networkFunctionName, String componentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkFunctionName, componentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Component get(String resourceGroupName, String networkFunctionName, String componentName) { + ComponentInner inner = this.serviceClient().get(resourceGroupName, networkFunctionName, componentName); + if (inner != null) { + return new ComponentImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByNetworkFunction(String resourceGroupName, String networkFunctionName) { + PagedIterable inner = + this.serviceClient().listByNetworkFunction(resourceGroupName, networkFunctionName); + return Utils.mapPage(inner, inner1 -> new ComponentImpl(inner1, this.manager())); + } + + public PagedIterable listByNetworkFunction( + String resourceGroupName, String networkFunctionName, Context context) { + PagedIterable inner = + this.serviceClient().listByNetworkFunction(resourceGroupName, networkFunctionName, context); + return Utils.mapPage(inner, inner1 -> new ComponentImpl(inner1, this.manager())); + } + + private ComponentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaImpl.java new file mode 100644 index 000000000000..ec7b4e21fbe9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchema; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ConfigurationGroupSchemaImpl + implements ConfigurationGroupSchema, ConfigurationGroupSchema.Definition, ConfigurationGroupSchema.Update { + private ConfigurationGroupSchemaInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 ConfigurationGroupSchemaPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 ConfigurationGroupSchemaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String configurationGroupSchemaName; + + private TagsObject updateParameters; + + public ConfigurationGroupSchemaImpl withExistingPublisher(String resourceGroupName, String publisherName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + return this; + } + + public ConfigurationGroupSchema create() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .createOrUpdate( + resourceGroupName, publisherName, configurationGroupSchemaName, this.innerModel(), Context.NONE); + return this; + } + + public ConfigurationGroupSchema create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .createOrUpdate( + resourceGroupName, publisherName, configurationGroupSchemaName, this.innerModel(), context); + return this; + } + + ConfigurationGroupSchemaImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new ConfigurationGroupSchemaInner(); + this.serviceManager = serviceManager; + this.configurationGroupSchemaName = name; + } + + public ConfigurationGroupSchemaImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ConfigurationGroupSchema apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .updateWithResponse( + resourceGroupName, publisherName, configurationGroupSchemaName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ConfigurationGroupSchema apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .updateWithResponse( + resourceGroupName, publisherName, configurationGroupSchemaName, updateParameters, context) + .getValue(); + return this; + } + + ConfigurationGroupSchemaImpl( + ConfigurationGroupSchemaInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.configurationGroupSchemaName = Utils.getValueFromIdByName(innerObject.id(), "configurationGroupSchemas"); + } + + public ConfigurationGroupSchema refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, Context.NONE) + .getValue(); + return this; + } + + public ConfigurationGroupSchema refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupSchemas() + .getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, context) + .getValue(); + return this; + } + + public ConfigurationGroupSchemaVersionUpdateState updateState( + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + return serviceManager + .configurationGroupSchemas() + .updateState(resourceGroupName, publisherName, configurationGroupSchemaName, parameters); + } + + public ConfigurationGroupSchemaVersionUpdateState updateState( + ConfigurationGroupSchemaVersionUpdateStateInner parameters, Context context) { + return serviceManager + .configurationGroupSchemas() + .updateState(resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context); + } + + public ConfigurationGroupSchemaImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConfigurationGroupSchemaImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConfigurationGroupSchemaImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ConfigurationGroupSchemaImpl withProperties(ConfigurationGroupSchemaPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaVersionUpdateStateImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaVersionUpdateStateImpl.java new file mode 100644 index 000000000000..e7ab20e60005 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemaVersionUpdateStateImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +public final class ConfigurationGroupSchemaVersionUpdateStateImpl + implements ConfigurationGroupSchemaVersionUpdateState { + private ConfigurationGroupSchemaVersionUpdateStateInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + ConfigurationGroupSchemaVersionUpdateStateImpl( + ConfigurationGroupSchemaVersionUpdateStateInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VersionState versionState() { + return this.innerModel().versionState(); + } + + public ConfigurationGroupSchemaVersionUpdateStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasClientImpl.java new file mode 100644 index 000000000000..d4d951943473 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasClientImpl.java @@ -0,0 +1,1752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.ConfigurationGroupSchemasClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 ConfigurationGroupSchemasClient. */ +public final class ConfigurationGroupSchemasClientImpl implements ConfigurationGroupSchemasClient { + /** The proxy service used to perform REST calls. */ + private final ConfigurationGroupSchemasService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationGroupSchemasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationGroupSchemasClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ConfigurationGroupSchemasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientConfigurationGroupSchemas to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface ConfigurationGroupSchemasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("configurationGroupSchemaName") String configurationGroupSchemaName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("configurationGroupSchemaName") String configurationGroupSchemaName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConfigurationGroupSchemaInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("configurationGroupSchemaName") String configurationGroupSchemaName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("configurationGroupSchemaName") String configurationGroupSchemaName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("configurationGroupSchemaName") String configurationGroupSchemaName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConfigurationGroupSchemaVersionUpdateStateInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required 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 + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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())); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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)); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName)); + } + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName, context)); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String configurationGroupSchemaName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String configurationGroupSchemaName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String configurationGroupSchemaName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String configurationGroupSchemaName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String configurationGroupSchemaName) { + return this.beginDeleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName).getSyncPoller(); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String configurationGroupSchemaName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName, context) + .getSyncPoller(); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String configurationGroupSchemaName) { + return beginDeleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String configurationGroupSchemaName, Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String configurationGroupSchemaName) { + deleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName).block(); + } + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String configurationGroupSchemaName, Context context) { + deleteAsync(resourceGroupName, publisherName, configurationGroupSchemaName, context).block(); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationGroupSchemaInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupSchemaInner.class, + ConfigurationGroupSchemaInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationGroupSchemaInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupSchemaInner.class, + ConfigurationGroupSchemaInner.class, + context); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationGroupSchemaInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationGroupSchemaInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaInner createOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters) { + return createOrUpdateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters).block(); + } + + /** + * Creates or updates a configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update configuration group schema resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaInner createOrUpdate( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .block(); + } + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String configurationGroupSchemaName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String publisherName, String configurationGroupSchemaName) { + return getWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context) { + return getWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName, context).block(); + } + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaInner get( + String resourceGroupName, String publisherName, String configurationGroupSchemaName) { + return getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, Context.NONE).getValue(); + } + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, TagsObject parameters) { + return updateWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .block(); + } + + /** + * Updates a configuration group schema resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration group schema resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaInner update( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, TagsObject parameters) { + return updateWithResponse( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, Context.NONE) + .getValue(); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (configurationGroupSchemaName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupSchemaName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + configurationGroupSchemaName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + Mono>> mono = + updateStateWithResponseAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupSchemaVersionUpdateStateInner.class, + ConfigurationGroupSchemaVersionUpdateStateInner.class, + this.client.getContext()); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupSchemaVersionUpdateStateInner.class, + ConfigurationGroupSchemaVersionUpdateStateInner.class, + context); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + return this + .beginUpdateStateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters) + .getSyncPoller(); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationGroupSchemaVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + return this + .beginUpdateStateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .getSyncPoller(); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + return beginUpdateStateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + return beginUpdateStateAsync( + resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + return updateStateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters).block(); + } + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupSchemaVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + return updateStateAsync(resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of configuration group schema resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of configuration group schema resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasImpl.java new file mode 100644 index 000000000000..bad3241bde79 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupSchemasImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ConfigurationGroupSchemasClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchema; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemas; + +public final class ConfigurationGroupSchemasImpl implements ConfigurationGroupSchemas { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationGroupSchemasImpl.class); + + private final ConfigurationGroupSchemasClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ConfigurationGroupSchemasImpl( + ConfigurationGroupSchemasClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupSchemaImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName, context); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupSchemaImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String publisherName, String configurationGroupSchemaName) { + this.serviceClient().delete(resourceGroupName, publisherName, configurationGroupSchemaName); + } + + public void delete( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, configurationGroupSchemaName, context); + } + + public Response getWithResponse( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigurationGroupSchemaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationGroupSchema get( + String resourceGroupName, String publisherName, String configurationGroupSchemaName) { + ConfigurationGroupSchemaInner inner = + this.serviceClient().get(resourceGroupName, publisherName, configurationGroupSchemaName); + if (inner != null) { + return new ConfigurationGroupSchemaImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationGroupSchemaVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters) { + ConfigurationGroupSchemaVersionUpdateStateInner inner = + this + .serviceClient() + .updateState(resourceGroupName, publisherName, configurationGroupSchemaName, parameters); + if (inner != null) { + return new ConfigurationGroupSchemaVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationGroupSchemaVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context) { + ConfigurationGroupSchemaVersionUpdateStateInner inner = + this + .serviceClient() + .updateState(resourceGroupName, publisherName, configurationGroupSchemaName, parameters, context); + if (inner != null) { + return new ConfigurationGroupSchemaVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationGroupSchema getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String configurationGroupSchemaName = Utils.getValueFromIdByName(id, "configurationGroupSchemas"); + if (configurationGroupSchemaName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupSchemas'.", + id))); + } + return this + .getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String configurationGroupSchemaName = Utils.getValueFromIdByName(id, "configurationGroupSchemas"); + if (configurationGroupSchemaName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupSchemas'.", + id))); + } + return this.getWithResponse(resourceGroupName, publisherName, configurationGroupSchemaName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String configurationGroupSchemaName = Utils.getValueFromIdByName(id, "configurationGroupSchemas"); + if (configurationGroupSchemaName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupSchemas'.", + id))); + } + this.delete(resourceGroupName, publisherName, configurationGroupSchemaName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String configurationGroupSchemaName = Utils.getValueFromIdByName(id, "configurationGroupSchemas"); + if (configurationGroupSchemaName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupSchemas'.", + id))); + } + this.delete(resourceGroupName, publisherName, configurationGroupSchemaName, context); + } + + private ConfigurationGroupSchemasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public ConfigurationGroupSchemaImpl define(String name) { + return new ConfigurationGroupSchemaImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValueImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValueImpl.java new file mode 100644 index 000000000000..b41c34aa4ee2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValueImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValue; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValuePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ConfigurationGroupValueImpl + implements ConfigurationGroupValue, ConfigurationGroupValue.Definition, ConfigurationGroupValue.Update { + private ConfigurationGroupValueInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 ConfigurationGroupValuePropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 ConfigurationGroupValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String configurationGroupValueName; + + private TagsObject updateParameters; + + public ConfigurationGroupValueImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ConfigurationGroupValue create() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .createOrUpdate(resourceGroupName, configurationGroupValueName, this.innerModel(), Context.NONE); + return this; + } + + public ConfigurationGroupValue create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .createOrUpdate(resourceGroupName, configurationGroupValueName, this.innerModel(), context); + return this; + } + + ConfigurationGroupValueImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new ConfigurationGroupValueInner(); + this.serviceManager = serviceManager; + this.configurationGroupValueName = name; + } + + public ConfigurationGroupValueImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ConfigurationGroupValue apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .updateTagsWithResponse(resourceGroupName, configurationGroupValueName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ConfigurationGroupValue apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .updateTagsWithResponse(resourceGroupName, configurationGroupValueName, updateParameters, context) + .getValue(); + return this; + } + + ConfigurationGroupValueImpl( + ConfigurationGroupValueInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.configurationGroupValueName = Utils.getValueFromIdByName(innerObject.id(), "configurationGroupValues"); + } + + public ConfigurationGroupValue refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, Context.NONE) + .getValue(); + return this; + } + + public ConfigurationGroupValue refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationGroupValues() + .getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, context) + .getValue(); + return this; + } + + public ConfigurationGroupValueImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConfigurationGroupValueImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConfigurationGroupValueImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ConfigurationGroupValueImpl withProperties(ConfigurationGroupValuePropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesClientImpl.java new file mode 100644 index 000000000000..bdea5c7becf1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesClientImpl.java @@ -0,0 +1,1500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.ConfigurationGroupValuesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValueListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 ConfigurationGroupValuesClient. */ +public final class ConfigurationGroupValuesClientImpl implements ConfigurationGroupValuesClient { + /** The proxy service used to perform REST calls. */ + private final ConfigurationGroupValuesService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationGroupValuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationGroupValuesClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ConfigurationGroupValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientConfigurationGroupValues to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface ConfigurationGroupValuesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("configurationGroupValueName") String configurationGroupValueName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("configurationGroupValueName") String configurationGroupValueName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("configurationGroupValueName") String configurationGroupValueName, + @BodyParam("application/json") ConfigurationGroupValueInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("configurationGroupValueName") String configurationGroupValueName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 configurationGroupValueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 configurationGroupValueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + accept, + context); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 configurationGroupValueName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, configurationGroupValueName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 configurationGroupValueName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, configurationGroupValueName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 configurationGroupValueName) { + return this.beginDeleteAsync(resourceGroupName, configurationGroupValueName).getSyncPoller(); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 configurationGroupValueName, Context context) { + return this.beginDeleteAsync(resourceGroupName, configurationGroupValueName, context).getSyncPoller(); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 configurationGroupValueName) { + return beginDeleteAsync(resourceGroupName, configurationGroupValueName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 configurationGroupValueName, Context context) { + return beginDeleteAsync(resourceGroupName, configurationGroupValueName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 configurationGroupValueName) { + deleteAsync(resourceGroupName, configurationGroupValueName).block(); + } + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 configurationGroupValueName, Context context) { + deleteAsync(resourceGroupName, configurationGroupValueName, context).block(); + } + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String configurationGroupValueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String configurationGroupValueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + accept, + context); + } + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String configurationGroupValueName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, configurationGroupValueName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String configurationGroupValueName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, configurationGroupValueName, context).block(); + } + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupValueInner getByResourceGroup( + String resourceGroupName, String configurationGroupValueName) { + return getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, Context.NONE).getValue(); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + parameters, + accept, + context); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationGroupValueInner> beginCreateOrUpdateAsync( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, configurationGroupValueName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupValueInner.class, + ConfigurationGroupValueInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationGroupValueInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, configurationGroupValueName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationGroupValueInner.class, + ConfigurationGroupValueInner.class, + context); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationGroupValueInner> beginCreateOrUpdate( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationGroupValueInner> beginCreateOrUpdate( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupValueInner createOrUpdate( + String resourceGroupName, String configurationGroupValueName, ConfigurationGroupValueInner parameters) { + return createOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters).block(); + } + + /** + * Creates or updates a hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to the create or update configuration group value resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupValueInner createOrUpdate( + String resourceGroupName, + String configurationGroupValueName, + ConfigurationGroupValueInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, configurationGroupValueName, parameters, context).block(); + } + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (configurationGroupValueName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationGroupValueName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + configurationGroupValueName, + parameters, + accept, + context); + } + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, configurationGroupValueName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, configurationGroupValueName, parameters, context).block(); + } + + /** + * Updates a hybrid configuration group tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param parameters Parameters supplied to update configuration group values tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hybrid configuration group value resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationGroupValueInner updateTags( + String resourceGroupName, String configurationGroupValueName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, configurationGroupValueName, parameters, Context.NONE) + .getValue(); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesImpl.java new file mode 100644 index 000000000000..c5a2c0580a03 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ConfigurationGroupValuesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ConfigurationGroupValuesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValue; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValues; + +public final class ConfigurationGroupValuesImpl implements ConfigurationGroupValues { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationGroupValuesImpl.class); + + private final ConfigurationGroupValuesClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ConfigurationGroupValuesImpl( + ConfigurationGroupValuesClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String configurationGroupValueName) { + this.serviceClient().delete(resourceGroupName, configurationGroupValueName); + } + + public void delete(String resourceGroupName, String configurationGroupValueName, Context context) { + this.serviceClient().delete(resourceGroupName, configurationGroupValueName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String configurationGroupValueName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigurationGroupValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationGroupValue getByResourceGroup(String resourceGroupName, String configurationGroupValueName) { + ConfigurationGroupValueInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, configurationGroupValueName); + if (inner != null) { + return new ConfigurationGroupValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupValueImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupValueImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupValueImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ConfigurationGroupValueImpl(inner1, this.manager())); + } + + public ConfigurationGroupValue getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configurationGroupValueName = Utils.getValueFromIdByName(id, "configurationGroupValues"); + if (configurationGroupValueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupValues'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configurationGroupValueName = Utils.getValueFromIdByName(id, "configurationGroupValues"); + if (configurationGroupValueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupValues'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, configurationGroupValueName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configurationGroupValueName = Utils.getValueFromIdByName(id, "configurationGroupValues"); + if (configurationGroupValueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupValues'.", + id))); + } + this.delete(resourceGroupName, configurationGroupValueName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configurationGroupValueName = Utils.getValueFromIdByName(id, "configurationGroupValues"); + if (configurationGroupValueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationGroupValues'.", + id))); + } + this.delete(resourceGroupName, configurationGroupValueName, context); + } + + private ConfigurationGroupValuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public ConfigurationGroupValueImpl define(String name) { + return new ConfigurationGroupValueImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.java deleted file mode 100644 index 35fc04f8831c..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.DevicesClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; -import com.azure.resourcemanager.hybridnetwork.models.Device; -import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; -import com.azure.resourcemanager.hybridnetwork.models.Devices; - -public final class DevicesImpl implements Devices { - private static final ClientLogger LOGGER = new ClientLogger(DevicesImpl.class); - - private final DevicesClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public DevicesImpl( - DevicesClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void deleteByResourceGroup(String resourceGroupName, String deviceName) { - this.serviceClient().delete(resourceGroupName, deviceName); - } - - public void delete(String resourceGroupName, String deviceName, Context context) { - this.serviceClient().delete(resourceGroupName, deviceName, context); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String deviceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deviceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DeviceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Device getByResourceGroup(String resourceGroupName, String deviceName) { - DeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deviceName); - if (inner != null) { - return new DeviceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public Response listRegistrationKeyWithResponse( - String resourceGroupName, String deviceName, Context context) { - Response inner = - this.serviceClient().listRegistrationKeyWithResponse(resourceGroupName, deviceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DeviceRegistrationKeyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DeviceRegistrationKey listRegistrationKey(String resourceGroupName, String deviceName) { - DeviceRegistrationKeyInner inner = this.serviceClient().listRegistrationKey(resourceGroupName, deviceName); - if (inner != null) { - return new DeviceRegistrationKeyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Device getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String deviceName = Utils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String deviceName = Utils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String deviceName = Utils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - this.delete(resourceGroupName, deviceName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String deviceName = Utils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - this.delete(resourceGroupName, deviceName, context); - } - - private DevicesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - public DeviceImpl define(String name) { - return new DeviceImpl(name, this.manager()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java index 7bde4f1fc35a..67c87ca24707 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientBuilder.java @@ -137,7 +137,7 @@ public HybridNetworkManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java index 88805f7b884b..83278a3433c9 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/HybridNetworkManagementClientImpl.java @@ -22,17 +22,22 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridnetwork.fluent.DevicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ArtifactManifestsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ArtifactStoresClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ComponentsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ConfigurationGroupSchemasClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ConfigurationGroupValuesClient; import com.azure.resourcemanager.hybridnetwork.fluent.HybridNetworkManagementClient; -import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionDefinitionGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionDefinitionVersionsClient; import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkServiceDesignGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkServiceDesignVersionsClient; import com.azure.resourcemanager.hybridnetwork.fluent.OperationsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.RoleInstancesClient; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorNetworkFunctionsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkuPreviewsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.ProxyArtifactsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.PublishersClient; +import com.azure.resourcemanager.hybridnetwork.fluent.SiteNetworkServicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.SitesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -117,6 +122,30 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The ConfigurationGroupSchemasClient object to access its operations. */ + private final ConfigurationGroupSchemasClient configurationGroupSchemas; + + /** + * Gets the ConfigurationGroupSchemasClient object to access its operations. + * + * @return the ConfigurationGroupSchemasClient object. + */ + public ConfigurationGroupSchemasClient getConfigurationGroupSchemas() { + return this.configurationGroupSchemas; + } + + /** The ConfigurationGroupValuesClient object to access its operations. */ + private final ConfigurationGroupValuesClient configurationGroupValues; + + /** + * Gets the ConfigurationGroupValuesClient object to access its operations. + * + * @return the ConfigurationGroupValuesClient object. + */ + public ConfigurationGroupValuesClient getConfigurationGroupValues() { + return this.configurationGroupValues; + } + /** The NetworkFunctionsClient object to access its operations. */ private final NetworkFunctionsClient networkFunctions; @@ -129,112 +158,148 @@ public NetworkFunctionsClient getNetworkFunctions() { return this.networkFunctions; } - /** The DevicesClient object to access its operations. */ - private final DevicesClient devices; + /** The ComponentsClient object to access its operations. */ + private final ComponentsClient components; /** - * Gets the DevicesClient object to access its operations. + * Gets the ComponentsClient object to access its operations. * - * @return the DevicesClient object. + * @return the ComponentsClient object. */ - public DevicesClient getDevices() { - return this.devices; + public ComponentsClient getComponents() { + return this.components; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The NetworkFunctionDefinitionGroupsClient object to access its operations. */ + private final NetworkFunctionDefinitionGroupsClient networkFunctionDefinitionGroups; /** - * Gets the OperationsClient object to access its operations. + * Gets the NetworkFunctionDefinitionGroupsClient object to access its operations. * - * @return the OperationsClient object. + * @return the NetworkFunctionDefinitionGroupsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public NetworkFunctionDefinitionGroupsClient getNetworkFunctionDefinitionGroups() { + return this.networkFunctionDefinitionGroups; + } + + /** The NetworkFunctionDefinitionVersionsClient object to access its operations. */ + private final NetworkFunctionDefinitionVersionsClient networkFunctionDefinitionVersions; + + /** + * Gets the NetworkFunctionDefinitionVersionsClient object to access its operations. + * + * @return the NetworkFunctionDefinitionVersionsClient object. + */ + public NetworkFunctionDefinitionVersionsClient getNetworkFunctionDefinitionVersions() { + return this.networkFunctionDefinitionVersions; } - /** The VendorsClient object to access its operations. */ - private final VendorsClient vendors; + /** The NetworkServiceDesignGroupsClient object to access its operations. */ + private final NetworkServiceDesignGroupsClient networkServiceDesignGroups; /** - * Gets the VendorsClient object to access its operations. + * Gets the NetworkServiceDesignGroupsClient object to access its operations. * - * @return the VendorsClient object. + * @return the NetworkServiceDesignGroupsClient object. */ - public VendorsClient getVendors() { - return this.vendors; + public NetworkServiceDesignGroupsClient getNetworkServiceDesignGroups() { + return this.networkServiceDesignGroups; + } + + /** The NetworkServiceDesignVersionsClient object to access its operations. */ + private final NetworkServiceDesignVersionsClient networkServiceDesignVersions; + + /** + * Gets the NetworkServiceDesignVersionsClient object to access its operations. + * + * @return the NetworkServiceDesignVersionsClient object. + */ + public NetworkServiceDesignVersionsClient getNetworkServiceDesignVersions() { + return this.networkServiceDesignVersions; + } + + /** 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 VendorSkusClient object to access its operations. */ - private final VendorSkusClient vendorSkus; + /** The PublishersClient object to access its operations. */ + private final PublishersClient publishers; /** - * Gets the VendorSkusClient object to access its operations. + * Gets the PublishersClient object to access its operations. * - * @return the VendorSkusClient object. + * @return the PublishersClient object. */ - public VendorSkusClient getVendorSkus() { - return this.vendorSkus; + public PublishersClient getPublishers() { + return this.publishers; } - /** The VendorSkuPreviewsClient object to access its operations. */ - private final VendorSkuPreviewsClient vendorSkuPreviews; + /** The ArtifactStoresClient object to access its operations. */ + private final ArtifactStoresClient artifactStores; /** - * Gets the VendorSkuPreviewsClient object to access its operations. + * Gets the ArtifactStoresClient object to access its operations. * - * @return the VendorSkuPreviewsClient object. + * @return the ArtifactStoresClient object. */ - public VendorSkuPreviewsClient getVendorSkuPreviews() { - return this.vendorSkuPreviews; + public ArtifactStoresClient getArtifactStores() { + return this.artifactStores; } - /** The NetworkFunctionVendorsClient object to access its operations. */ - private final NetworkFunctionVendorsClient networkFunctionVendors; + /** The ArtifactManifestsClient object to access its operations. */ + private final ArtifactManifestsClient artifactManifests; /** - * Gets the NetworkFunctionVendorsClient object to access its operations. + * Gets the ArtifactManifestsClient object to access its operations. * - * @return the NetworkFunctionVendorsClient object. + * @return the ArtifactManifestsClient object. */ - public NetworkFunctionVendorsClient getNetworkFunctionVendors() { - return this.networkFunctionVendors; + public ArtifactManifestsClient getArtifactManifests() { + return this.artifactManifests; } - /** The NetworkFunctionVendorSkusClient object to access its operations. */ - private final NetworkFunctionVendorSkusClient networkFunctionVendorSkus; + /** The ProxyArtifactsClient object to access its operations. */ + private final ProxyArtifactsClient proxyArtifacts; /** - * Gets the NetworkFunctionVendorSkusClient object to access its operations. + * Gets the ProxyArtifactsClient object to access its operations. * - * @return the NetworkFunctionVendorSkusClient object. + * @return the ProxyArtifactsClient object. */ - public NetworkFunctionVendorSkusClient getNetworkFunctionVendorSkus() { - return this.networkFunctionVendorSkus; + public ProxyArtifactsClient getProxyArtifacts() { + return this.proxyArtifacts; } - /** The VendorNetworkFunctionsClient object to access its operations. */ - private final VendorNetworkFunctionsClient vendorNetworkFunctions; + /** The SitesClient object to access its operations. */ + private final SitesClient sites; /** - * Gets the VendorNetworkFunctionsClient object to access its operations. + * Gets the SitesClient object to access its operations. * - * @return the VendorNetworkFunctionsClient object. + * @return the SitesClient object. */ - public VendorNetworkFunctionsClient getVendorNetworkFunctions() { - return this.vendorNetworkFunctions; + public SitesClient getSites() { + return this.sites; } - /** The RoleInstancesClient object to access its operations. */ - private final RoleInstancesClient roleInstances; + /** The SiteNetworkServicesClient object to access its operations. */ + private final SiteNetworkServicesClient siteNetworkServices; /** - * Gets the RoleInstancesClient object to access its operations. + * Gets the SiteNetworkServicesClient object to access its operations. * - * @return the RoleInstancesClient object. + * @return the SiteNetworkServicesClient object. */ - public RoleInstancesClient getRoleInstances() { - return this.roleInstances; + public SiteNetworkServicesClient getSiteNetworkServices() { + return this.siteNetworkServices; } /** @@ -259,17 +324,22 @@ public RoleInstancesClient getRoleInstances() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-05-01"; + this.apiVersion = "2023-09-01"; + this.configurationGroupSchemas = new ConfigurationGroupSchemasClientImpl(this); + this.configurationGroupValues = new ConfigurationGroupValuesClientImpl(this); this.networkFunctions = new NetworkFunctionsClientImpl(this); - this.devices = new DevicesClientImpl(this); + this.components = new ComponentsClientImpl(this); + this.networkFunctionDefinitionGroups = new NetworkFunctionDefinitionGroupsClientImpl(this); + this.networkFunctionDefinitionVersions = new NetworkFunctionDefinitionVersionsClientImpl(this); + this.networkServiceDesignGroups = new NetworkServiceDesignGroupsClientImpl(this); + this.networkServiceDesignVersions = new NetworkServiceDesignVersionsClientImpl(this); this.operations = new OperationsClientImpl(this); - this.vendors = new VendorsClientImpl(this); - this.vendorSkus = new VendorSkusClientImpl(this); - this.vendorSkuPreviews = new VendorSkuPreviewsClientImpl(this); - this.networkFunctionVendors = new NetworkFunctionVendorsClientImpl(this); - this.networkFunctionVendorSkus = new NetworkFunctionVendorSkusClientImpl(this); - this.vendorNetworkFunctions = new VendorNetworkFunctionsClientImpl(this); - this.roleInstances = new RoleInstancesClientImpl(this); + this.publishers = new PublishersClientImpl(this); + this.artifactStores = new ArtifactStoresClientImpl(this); + this.artifactManifests = new ArtifactManifestsClientImpl(this); + this.proxyArtifacts = new ProxyArtifactsClientImpl(this); + this.sites = new SitesClientImpl(this); + this.siteNetworkServices = new SiteNetworkServicesClientImpl(this); } /** diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupImpl.java new file mode 100644 index 000000000000..eea08b726111 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroup; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroupPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class NetworkFunctionDefinitionGroupImpl + implements NetworkFunctionDefinitionGroup, + NetworkFunctionDefinitionGroup.Definition, + NetworkFunctionDefinitionGroup.Update { + private NetworkFunctionDefinitionGroupInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 NetworkFunctionDefinitionGroupPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 NetworkFunctionDefinitionGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String networkFunctionDefinitionGroupName; + + private TagsObject updateParameters; + + public NetworkFunctionDefinitionGroupImpl withExistingPublisher(String resourceGroupName, String publisherName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + return this; + } + + public NetworkFunctionDefinitionGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .createOrUpdate( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public NetworkFunctionDefinitionGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .createOrUpdate( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, this.innerModel(), context); + return this; + } + + NetworkFunctionDefinitionGroupImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new NetworkFunctionDefinitionGroupInner(); + this.serviceManager = serviceManager; + this.networkFunctionDefinitionGroupName = name; + } + + public NetworkFunctionDefinitionGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkFunctionDefinitionGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .updateWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .updateWithResponse( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, updateParameters, context) + .getValue(); + return this; + } + + NetworkFunctionDefinitionGroupImpl( + NetworkFunctionDefinitionGroupInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.networkFunctionDefinitionGroupName = + Utils.getValueFromIdByName(innerObject.id(), "networkFunctionDefinitionGroups"); + } + + public NetworkFunctionDefinitionGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, Context.NONE) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionGroups() + .getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFunctionDefinitionGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFunctionDefinitionGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkFunctionDefinitionGroupImpl withProperties( + NetworkFunctionDefinitionGroupPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsClientImpl.java new file mode 100644 index 000000000000..ae004ae0128a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsClientImpl.java @@ -0,0 +1,1422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionDefinitionGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroupListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 NetworkFunctionDefinitionGroupsClient. */ +public final class NetworkFunctionDefinitionGroupsClientImpl implements NetworkFunctionDefinitionGroupsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkFunctionDefinitionGroupsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkFunctionDefinitionGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFunctionDefinitionGroupsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkFunctionDefinitionGroupsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionDefinitionGroups to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface NetworkFunctionDefinitionGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkFunctionDefinitionGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required 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 + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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())); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + 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)); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName)); + } + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName, context)); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkFunctionDefinitionGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkFunctionDefinitionGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkFunctionDefinitionGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkFunctionDefinitionGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String networkFunctionDefinitionGroupName) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName) + .getSyncPoller(); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String networkFunctionDefinitionGroupName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String networkFunctionDefinitionGroupName) { + return beginDeleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String networkFunctionDefinitionGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String networkFunctionDefinitionGroupName) { + deleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName).block(); + } + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String networkFunctionDefinitionGroupName, Context context) { + deleteAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context).block(); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionGroupInner.class, + NetworkFunctionDefinitionGroupInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionGroupInner.class, + NetworkFunctionDefinitionGroupInner.class, + context); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFunctionDefinitionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters) + .block(); + } + + /** + * Creates or updates a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + NetworkFunctionDefinitionGroupInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, context) + .block(); + } + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + return getWithResponseAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context) + .block(); + } + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionGroupInner get( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + return getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, Context.NONE) + .getValue(); + } + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters) { + return updateWithResponseAsync(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, context) + .block(); + } + + /** + * Updates a network function definition group resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param parameters Parameters supplied to the create or update publisher network function definition group + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionGroupInner update( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + TagsObject parameters) { + return updateWithResponse( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network function definition group resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync( + 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.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network function definition group resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsImpl.java new file mode 100644 index 000000000000..fa3b2b489821 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionGroupsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionDefinitionGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroup; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroups; + +public final class NetworkFunctionDefinitionGroupsImpl implements NetworkFunctionDefinitionGroups { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionDefinitionGroupsImpl.class); + + private final NetworkFunctionDefinitionGroupsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkFunctionDefinitionGroupsImpl( + NetworkFunctionDefinitionGroupsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionDefinitionGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionDefinitionGroupImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + this.serviceClient().delete(resourceGroupName, publisherName, networkFunctionDefinitionGroupName); + } + + public void delete( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + } + + public Response getWithResponse( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFunctionDefinitionGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFunctionDefinitionGroup get( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + NetworkFunctionDefinitionGroupInner inner = + this.serviceClient().get(resourceGroupName, publisherName, networkFunctionDefinitionGroupName); + if (inner != null) { + return new NetworkFunctionDefinitionGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkFunctionDefinitionGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + return this + .getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + return this.getWithResponse(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + this.delete(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + this.delete(resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + } + + private NetworkFunctionDefinitionGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public NetworkFunctionDefinitionGroupImpl define(String name) { + return new NetworkFunctionDefinitionGroupImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionImpl.java new file mode 100644 index 000000000000..2f4a160f87d8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersion; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class NetworkFunctionDefinitionVersionImpl + implements NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersion.Definition, + NetworkFunctionDefinitionVersion.Update { + private NetworkFunctionDefinitionVersionInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 NetworkFunctionDefinitionVersionPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 NetworkFunctionDefinitionVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String networkFunctionDefinitionGroupName; + + private String networkFunctionDefinitionVersionName; + + private TagsObject updateParameters; + + public NetworkFunctionDefinitionVersionImpl withExistingNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + this.networkFunctionDefinitionGroupName = networkFunctionDefinitionGroupName; + return this; + } + + public NetworkFunctionDefinitionVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .createOrUpdate( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.innerModel(), + Context.NONE); + return this; + } + + public NetworkFunctionDefinitionVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .createOrUpdate( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.innerModel(), + context); + return this; + } + + NetworkFunctionDefinitionVersionImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new NetworkFunctionDefinitionVersionInner(); + this.serviceManager = serviceManager; + this.networkFunctionDefinitionVersionName = name; + } + + public NetworkFunctionDefinitionVersionImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkFunctionDefinitionVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .updateWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .updateWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + updateParameters, + context) + .getValue(); + return this; + } + + NetworkFunctionDefinitionVersionImpl( + NetworkFunctionDefinitionVersionInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.networkFunctionDefinitionGroupName = + Utils.getValueFromIdByName(innerObject.id(), "networkFunctionDefinitionGroups"); + this.networkFunctionDefinitionVersionName = + Utils.getValueFromIdByName(innerObject.id(), "networkFunctionDefinitionVersions"); + } + + public NetworkFunctionDefinitionVersion refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + Context.NONE) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionVersion refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFunctionDefinitionVersions() + .getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context) + .getValue(); + return this; + } + + public NetworkFunctionDefinitionVersionUpdateState updateState( + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + return serviceManager + .networkFunctionDefinitionVersions() + .updateState( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters); + } + + public NetworkFunctionDefinitionVersionUpdateState updateState( + NetworkFunctionDefinitionVersionUpdateStateInner parameters, Context context) { + return serviceManager + .networkFunctionDefinitionVersions() + .updateState( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context); + } + + public NetworkFunctionDefinitionVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFunctionDefinitionVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFunctionDefinitionVersionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkFunctionDefinitionVersionImpl withProperties( + NetworkFunctionDefinitionVersionPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionUpdateStateImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionUpdateStateImpl.java new file mode 100644 index 000000000000..94bdffa97961 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionUpdateStateImpl.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.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +public final class NetworkFunctionDefinitionVersionUpdateStateImpl + implements NetworkFunctionDefinitionVersionUpdateState { + private NetworkFunctionDefinitionVersionUpdateStateInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + NetworkFunctionDefinitionVersionUpdateStateImpl( + NetworkFunctionDefinitionVersionUpdateStateInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VersionState versionState() { + return this.innerModel().versionState(); + } + + public NetworkFunctionDefinitionVersionUpdateStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsClientImpl.java new file mode 100644 index 000000000000..a53db13f7aa2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsClientImpl.java @@ -0,0 +1,2200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionDefinitionVersionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 NetworkFunctionDefinitionVersionsClient. + */ +public final class NetworkFunctionDefinitionVersionsClientImpl implements NetworkFunctionDefinitionVersionsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkFunctionDefinitionVersionsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkFunctionDefinitionVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFunctionDefinitionVersionsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkFunctionDefinitionVersionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionDefinitionVersions to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface NetworkFunctionDefinitionVersionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @PathParam("networkFunctionDefinitionVersionName") String networkFunctionDefinitionVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @PathParam("networkFunctionDefinitionVersionName") String networkFunctionDefinitionVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkFunctionDefinitionVersionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @PathParam("networkFunctionDefinitionVersionName") String networkFunctionDefinitionVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @PathParam("networkFunctionDefinitionVersionName") String networkFunctionDefinitionVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNetworkFunctionDefinitionGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkFunctionDefinitionGroupName") String networkFunctionDefinitionGroupName, + @PathParam("networkFunctionDefinitionVersionName") String networkFunctionDefinitionVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkFunctionDefinitionVersionUpdateStateInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNetworkFunctionDefinitionGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + return this + .beginDeleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName) + .getSyncPoller(); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + return this + .beginDeleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context) + .getSyncPoller(); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + return beginDeleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + deleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName) + .block(); + } + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + deleteAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context) + .block(); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionVersionInner.class, + NetworkFunctionDefinitionVersionInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionVersionInner.class, + NetworkFunctionDefinitionVersionInner.class, + context); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network function definition version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFunctionDefinitionVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters) { + return createOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .block(); + } + + /** + * Creates or updates a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .block(); + } + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + return getWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context) + .block(); + } + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionInner get( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + return getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + Context.NONE) + .getValue(); + } + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters) { + return updateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .block(); + } + + /** + * Updates a network function definition version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network function definition version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network function definition version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionInner update( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + TagsObject parameters) { + return updateWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + Context.NONE) + .getValue(); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByNetworkFunctionDefinitionGroupSinglePageAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required 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 + .listByNetworkFunctionDefinitionGroup( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + 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())); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByNetworkFunctionDefinitionGroupSinglePageAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNetworkFunctionDefinitionGroup( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + 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)); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNetworkFunctionDefinitionGroupAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + return new PagedFlux<>( + () -> + listByNetworkFunctionDefinitionGroupSinglePageAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName), + nextLink -> listByNetworkFunctionDefinitionGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNetworkFunctionDefinitionGroupAsync( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + return new PagedFlux<>( + () -> + listByNetworkFunctionDefinitionGroupSinglePageAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context), + nextLink -> listByNetworkFunctionDefinitionGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + return new PagedIterable<>( + listByNetworkFunctionDefinitionGroupAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName)); + } + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + return new PagedIterable<>( + listByNetworkFunctionDefinitionGroupAsync( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context)); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkFunctionDefinitionGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionGroupName is required and cannot be null.")); + } + if (networkFunctionDefinitionVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFunctionDefinitionVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionVersionUpdateStateInner.class, + NetworkFunctionDefinitionVersionUpdateStateInner.class, + this.client.getContext()); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFunctionDefinitionVersionUpdateStateInner.class, + NetworkFunctionDefinitionVersionUpdateStateInner.class, + context); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + return this + .beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .getSyncPoller(); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network function definition version update request + * definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + NetworkFunctionDefinitionVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + return this + .beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + return beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + return beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + return updateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters) + .block(); + } + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFunctionDefinitionVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + return updateStateAsync( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network function definition versions along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByNetworkFunctionDefinitionGroupNextSinglePageAsync(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 + .listByNetworkFunctionDefinitionGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network function definition versions along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByNetworkFunctionDefinitionGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNetworkFunctionDefinitionGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsImpl.java new file mode 100644 index 000000000000..7ced1a293bd6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionDefinitionVersionsImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionDefinitionVersionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersion; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersions; + +public final class NetworkFunctionDefinitionVersionsImpl implements NetworkFunctionDefinitionVersions { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionDefinitionVersionsImpl.class); + + private final NetworkFunctionDefinitionVersionsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkFunctionDefinitionVersionsImpl( + NetworkFunctionDefinitionVersionsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + this + .serviceClient() + .delete( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName); + } + + public void delete( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context); + } + + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFunctionDefinitionVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFunctionDefinitionVersion get( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName) { + NetworkFunctionDefinitionVersionInner inner = + this + .serviceClient() + .get( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName); + if (inner != null) { + return new NetworkFunctionDefinitionVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName) { + PagedIterable inner = + this + .serviceClient() + .listByNetworkFunctionDefinitionGroup( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionDefinitionVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByNetworkFunctionDefinitionGroup( + resourceGroupName, publisherName, networkFunctionDefinitionGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFunctionDefinitionVersionImpl(inner1, this.manager())); + } + + public NetworkFunctionDefinitionVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters) { + NetworkFunctionDefinitionVersionUpdateStateInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters); + if (inner != null) { + return new NetworkFunctionDefinitionVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkFunctionDefinitionVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context) { + NetworkFunctionDefinitionVersionUpdateStateInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + context); + if (inner != null) { + return new NetworkFunctionDefinitionVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkFunctionDefinitionVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + String networkFunctionDefinitionVersionName = + Utils.getValueFromIdByName(id, "networkFunctionDefinitionVersions"); + if (networkFunctionDefinitionVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionVersions'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + String networkFunctionDefinitionVersionName = + Utils.getValueFromIdByName(id, "networkFunctionDefinitionVersions"); + if (networkFunctionDefinitionVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionVersions'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + String networkFunctionDefinitionVersionName = + Utils.getValueFromIdByName(id, "networkFunctionDefinitionVersions"); + if (networkFunctionDefinitionVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionVersions'.", + id))); + } + this + .delete( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkFunctionDefinitionGroupName = Utils.getValueFromIdByName(id, "networkFunctionDefinitionGroups"); + if (networkFunctionDefinitionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionGroups'.", + id))); + } + String networkFunctionDefinitionVersionName = + Utils.getValueFromIdByName(id, "networkFunctionDefinitionVersions"); + if (networkFunctionDefinitionVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkFunctionDefinitionVersions'.", + id))); + } + this + .delete( + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + context); + } + + private NetworkFunctionDefinitionVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public NetworkFunctionDefinitionVersionImpl define(String name) { + return new NetworkFunctionDefinitionVersionImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java index 01abc5d87682..df66fd7fecd6 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionImpl.java @@ -5,18 +5,15 @@ package com.azure.resourcemanager.hybridnetwork.implementation; import com.azure.core.management.Region; -import com.azure.core.management.SubResource; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionPropertiesFormat; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; import java.util.Collections; -import java.util.List; import java.util.Map; public final class NetworkFunctionImpl implements NetworkFunction, NetworkFunction.Definition, NetworkFunction.Update { @@ -49,61 +46,20 @@ public Map tags() { } } - public String etag() { - return this.innerModel().etag(); + public NetworkFunctionPropertiesFormat properties() { + return this.innerModel().properties(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SubResource device() { - return this.innerModel().device(); - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public SkuType skuType() { - return this.innerModel().skuType(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public String serviceKey() { - return this.innerModel().serviceKey(); - } - - public VendorProvisioningState vendorProvisioningState() { - return this.innerModel().vendorProvisioningState(); - } - - public SubResource managedApplication() { - return this.innerModel().managedApplication(); - } - - public Object managedApplicationParameters() { - return this.innerModel().managedApplicationParameters(); + public String etag() { + return this.innerModel().etag(); } - public Object networkFunctionContainerConfigurations() { - return this.innerModel().networkFunctionContainerConfigurations(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } - public List networkFunctionUserConfigurations() { - List inner = this.innerModel().networkFunctionUserConfigurations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -214,6 +170,14 @@ public NetworkFunction refresh(Context context) { return this; } + public void executeRequest(ExecuteRequestParameters parameters) { + serviceManager.networkFunctions().executeRequest(resourceGroupName, networkFunctionName, parameters); + } + + public void executeRequest(ExecuteRequestParameters parameters, Context context) { + serviceManager.networkFunctions().executeRequest(resourceGroupName, networkFunctionName, parameters, context); + } + public NetworkFunctionImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -234,40 +198,18 @@ public NetworkFunctionImpl withTags(Map tags) { } } - public NetworkFunctionImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public NetworkFunctionImpl withDevice(SubResource device) { - this.innerModel().withDevice(device); - return this; - } - - public NetworkFunctionImpl withSkuName(String skuName) { - this.innerModel().withSkuName(skuName); - return this; - } - - public NetworkFunctionImpl withVendorName(String vendorName) { - this.innerModel().withVendorName(vendorName); - return this; - } - - public NetworkFunctionImpl withManagedApplicationParameters(Object managedApplicationParameters) { - this.innerModel().withManagedApplicationParameters(managedApplicationParameters); + public NetworkFunctionImpl withProperties(NetworkFunctionPropertiesFormat properties) { + this.innerModel().withProperties(properties); return this; } - public NetworkFunctionImpl withNetworkFunctionContainerConfigurations( - Object networkFunctionContainerConfigurations) { - this.innerModel().withNetworkFunctionContainerConfigurations(networkFunctionContainerConfigurations); + public NetworkFunctionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); return this; } - public NetworkFunctionImpl withNetworkFunctionUserConfigurations( - List networkFunctionUserConfigurations) { - this.innerModel().withNetworkFunctionUserConfigurations(networkFunctionUserConfigurations); + public NetworkFunctionImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.java deleted file mode 100644 index 0beed413e4f2..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionSkuRoleDetailsImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import java.util.Collections; -import java.util.List; - -public final class NetworkFunctionSkuRoleDetailsImpl implements NetworkFunctionSkuRoleDetails { - private NetworkFunctionSkuRoleDetailsInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - NetworkFunctionSkuRoleDetailsImpl( - NetworkFunctionSkuRoleDetailsInner innerObject, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String roleName() { - return this.innerModel().roleName(); - } - - public Object userDataTemplate() { - return this.innerModel().userDataTemplate(); - } - - public Object userDataParameters() { - return this.innerModel().userDataParameters(); - } - - public List networkInterfaces() { - List inner = this.innerModel().networkInterfaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public NetworkFunctionSkuRoleDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.java deleted file mode 100644 index 8514029a8cf3..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendor; -import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class NetworkFunctionVendorImpl implements NetworkFunctionVendor { - private NetworkFunctionVendorInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - NetworkFunctionVendorImpl( - NetworkFunctionVendorInner innerObject, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public List skuList() { - List inner = this.innerModel().skuList(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SkuOverviewImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public NetworkFunctionVendorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java deleted file mode 100644 index a23a3df1a393..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorSkusImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionVendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorSkus; -import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; - -public final class NetworkFunctionVendorSkusImpl implements NetworkFunctionVendorSkus { - private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionVendorSkusImpl.class); - - private final NetworkFunctionVendorSkusClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public NetworkFunctionVendorSkusImpl( - NetworkFunctionVendorSkusClient innerClient, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByVendor(String vendorName) { - PagedIterable inner = this.serviceClient().listByVendor(vendorName); - return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager())); - } - - public PagedIterable listByVendor(String vendorName, Context context) { - PagedIterable inner = this.serviceClient().listByVendor(vendorName, context); - return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager())); - } - - public PagedIterable listBySku(String vendorName, String vendorSkuName) { - PagedIterable inner = - this.serviceClient().listBySku(vendorName, vendorSkuName); - return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listBySku( - String vendorName, String vendorSkuName, Context context) { - PagedIterable inner = - this.serviceClient().listBySku(vendorName, vendorSkuName, context); - return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager())); - } - - private NetworkFunctionVendorSkusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java deleted file mode 100644 index 8c6a56d20485..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsClientImpl.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionVendorsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in NetworkFunctionVendorsClient. */ -public final class NetworkFunctionVendorsClientImpl implements NetworkFunctionVendorsClient { - /** The proxy service used to perform REST calls. */ - private final NetworkFunctionVendorsService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of NetworkFunctionVendorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkFunctionVendorsClientImpl(HybridNetworkManagementClientImpl client) { - this.service = - RestProxy - .create(NetworkFunctionVendorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientNetworkFunctionVendors to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface NetworkFunctionVendorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionVendors") - @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("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the available vendor and sku information. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result 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())); - } - - /** - * Lists all the available vendor and sku information. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the available vendor and sku information. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available vendor and sku information. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the available vendor and sku information. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the available vendor and sku information. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.java deleted file mode 100644 index 8ab762bd8a98..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionVendorsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionVendorsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendor; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendors; - -public final class NetworkFunctionVendorsImpl implements NetworkFunctionVendors { - private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionVendorsImpl.class); - - private final NetworkFunctionVendorsClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public NetworkFunctionVendorsImpl( - NetworkFunctionVendorsClient innerClient, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new NetworkFunctionVendorImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new NetworkFunctionVendorImpl(inner1, this.manager())); - } - - private NetworkFunctionVendorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java index 4bc364aa4af3..c05031cb6e42 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsClientImpl.java @@ -14,6 +14,7 @@ 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; @@ -34,6 +35,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionsClient; import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionListResult; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; import java.nio.ByteBuffer; @@ -65,11 +67,10 @@ public final class NetworkFunctionsClientImpl implements NetworkFunctionsClient */ @Host("{$host}") @ServiceInterface(name = "HybridNetworkManagem") - private interface NetworkFunctionsService { + public interface NetworkFunctionsService { @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/networkFunctions/{networkFunctionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -83,8 +84,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/networkFunctions/{networkFunctionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -98,8 +98,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/networkFunctions/{networkFunctionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -114,8 +113,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/networkFunctions/{networkFunctionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateTags( @@ -141,8 +139,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/networkFunctions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -153,6 +150,21 @@ Mono> listByResourceGroup( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> executeRequest( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkFunctionName") String networkFunctionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExecuteRequestParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -175,8 +187,7 @@ Mono> listByResourceGroupNext( } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -225,8 +236,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -273,8 +283,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -293,8 +302,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -316,8 +324,7 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -328,12 +335,11 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String networkFunctionName) { - return beginDeleteAsync(resourceGroupName, networkFunctionName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, networkFunctionName).getSyncPoller(); } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -346,12 +352,11 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String networkFunctionName, Context context) { - return beginDeleteAsync(resourceGroupName, networkFunctionName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, networkFunctionName, context).getSyncPoller(); } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -368,8 +373,7 @@ private Mono deleteAsync(String resourceGroupName, String networkFunctionN } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -387,8 +391,7 @@ private Mono deleteAsync(String resourceGroupName, String networkFunctionN } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -402,8 +405,7 @@ public void delete(String resourceGroupName, String networkFunctionName) { } /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -564,8 +566,7 @@ public NetworkFunctionInner getByResourceGroup(String resourceGroupName, String } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -621,8 +622,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -676,8 +676,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -703,8 +702,7 @@ private PollerFlux, NetworkFunctionInner> begin } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -728,8 +726,7 @@ private PollerFlux, NetworkFunctionInner> begin } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -742,12 +739,11 @@ private PollerFlux, NetworkFunctionInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters).getSyncPoller(); } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -761,12 +757,13 @@ public SyncPoller, NetworkFunctionInner> beginC @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NetworkFunctionInner> beginCreateOrUpdate( String resourceGroupName, String networkFunctionName, NetworkFunctionInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters, context).getSyncPoller(); + return this + .beginCreateOrUpdateAsync(resourceGroupName, networkFunctionName, parameters, context) + .getSyncPoller(); } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -785,8 +782,7 @@ private Mono createOrUpdateAsync( } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -806,8 +802,7 @@ private Mono createOrUpdateAsync( } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -824,8 +819,7 @@ public NetworkFunctionInner createOrUpdate( } /** - * Creates or updates a network function resource. This operation can take up to 6 hours to complete. This is - * expected service behavior. + * Creates or updates a network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName Resource name for the network function resource. @@ -1313,6 +1307,270 @@ public PagedIterable listByResourceGroup(String resourceGr return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> executeRequestWithResponseAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .executeRequest( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> executeRequestWithResponseAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkFunctionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFunctionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .executeRequest( + this.client.getEndpoint(), + resourceGroupName, + networkFunctionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginExecuteRequestAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + Mono>> mono = + executeRequestWithResponseAsync(resourceGroupName, networkFunctionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginExecuteRequestAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + executeRequestWithResponseAsync(resourceGroupName, networkFunctionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginExecuteRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + return this.beginExecuteRequestAsync(resourceGroupName, networkFunctionName, parameters).getSyncPoller(); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginExecuteRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + return this + .beginExecuteRequestAsync(resourceGroupName, networkFunctionName, parameters, context) + .getSyncPoller(); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 executeRequestAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + return beginExecuteRequestAsync(resourceGroupName, networkFunctionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 executeRequestAsync( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + return beginExecuteRequestAsync(resourceGroupName, networkFunctionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + executeRequestAsync(resourceGroupName, networkFunctionName, parameters).block(); + } + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + executeRequestAsync(resourceGroupName, networkFunctionName, parameters, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java index e35aa7928adf..6dd3c3fb7062 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkFunctionsImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridnetwork.fluent.NetworkFunctionsClient; import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctions; @@ -81,6 +82,16 @@ public PagedIterable listByResourceGroup(String resourceGroupNa return Utils.mapPage(inner, inner1 -> new NetworkFunctionImpl(inner1, this.manager())); } + public void executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters) { + this.serviceClient().executeRequest(resourceGroupName, networkFunctionName, parameters); + } + + public void executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context) { + this.serviceClient().executeRequest(resourceGroupName, networkFunctionName, parameters, context); + } + public NetworkFunction getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupImpl.java new file mode 100644 index 000000000000..312ef0a8ee67 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroup; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroupPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class NetworkServiceDesignGroupImpl + implements NetworkServiceDesignGroup, NetworkServiceDesignGroup.Definition, NetworkServiceDesignGroup.Update { + private NetworkServiceDesignGroupInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 NetworkServiceDesignGroupPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 NetworkServiceDesignGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String networkServiceDesignGroupName; + + private TagsObject updateParameters; + + public NetworkServiceDesignGroupImpl withExistingPublisher(String resourceGroupName, String publisherName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + return this; + } + + public NetworkServiceDesignGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .createOrUpdate( + resourceGroupName, publisherName, networkServiceDesignGroupName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkServiceDesignGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .createOrUpdate( + resourceGroupName, publisherName, networkServiceDesignGroupName, this.innerModel(), context); + return this; + } + + NetworkServiceDesignGroupImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new NetworkServiceDesignGroupInner(); + this.serviceManager = serviceManager; + this.networkServiceDesignGroupName = name; + } + + public NetworkServiceDesignGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkServiceDesignGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .updateWithResponse( + resourceGroupName, publisherName, networkServiceDesignGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkServiceDesignGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .updateWithResponse( + resourceGroupName, publisherName, networkServiceDesignGroupName, updateParameters, context) + .getValue(); + return this; + } + + NetworkServiceDesignGroupImpl( + NetworkServiceDesignGroupInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.networkServiceDesignGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkServiceDesignGroups"); + } + + public NetworkServiceDesignGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, Context.NONE) + .getValue(); + return this; + } + + public NetworkServiceDesignGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignGroups() + .getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, context) + .getValue(); + return this; + } + + public NetworkServiceDesignGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkServiceDesignGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkServiceDesignGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkServiceDesignGroupImpl withProperties(NetworkServiceDesignGroupPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsClientImpl.java new file mode 100644 index 000000000000..27848800b537 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsClientImpl.java @@ -0,0 +1,1387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkServiceDesignGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroupListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 NetworkServiceDesignGroupsClient. */ +public final class NetworkServiceDesignGroupsClientImpl implements NetworkServiceDesignGroupsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkServiceDesignGroupsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkServiceDesignGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkServiceDesignGroupsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkServiceDesignGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkServiceDesignGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface NetworkServiceDesignGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkServiceDesignGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + 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())); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String publisherName, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, publisherName, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName)); + } + + /** + * Gets information of the network service design groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, publisherName, context)); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkServiceDesignGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkServiceDesignGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkServiceDesignGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, networkServiceDesignGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, String networkServiceDesignGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String networkServiceDesignGroupName) { + return this.beginDeleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName).getSyncPoller(); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, String networkServiceDesignGroupName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String networkServiceDesignGroupName) { + return beginDeleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, String networkServiceDesignGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String networkServiceDesignGroupName) { + deleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName).block(); + } + + /** + * Deletes a specified network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, String networkServiceDesignGroupName, Context context) { + deleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, context).block(); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkServiceDesignGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignGroupInner.class, + NetworkServiceDesignGroupInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkServiceDesignGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignGroupInner.class, + NetworkServiceDesignGroupInner.class, + context); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkServiceDesignGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkServiceDesignGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, parameters).block(); + } + + /** + * Creates or updates a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignGroupInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + NetworkServiceDesignGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, context) + .block(); + } + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + return getWithResponseAsync(resourceGroupName, publisherName, networkServiceDesignGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, context).block(); + } + + /** + * Gets information about the specified networkServiceDesign group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkServiceDesign group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignGroupInner get( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + return getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, Context.NONE) + .getValue(); + } + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, TagsObject parameters) { + return updateWithResponseAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, context) + .block(); + } + + /** + * Updates a network service design groups resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param parameters Parameters supplied to the create or update publisher network service design group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignGroupInner update( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, TagsObject parameters) { + return updateWithResponse( + resourceGroupName, publisherName, networkServiceDesignGroupName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network service design group resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(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.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network service design group resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsImpl.java new file mode 100644 index 000000000000..69a312978bef --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignGroupsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkServiceDesignGroupsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroup; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroups; + +public final class NetworkServiceDesignGroupsImpl implements NetworkServiceDesignGroups { + private static final ClientLogger LOGGER = new ClientLogger(NetworkServiceDesignGroupsImpl.class); + + private final NetworkServiceDesignGroupsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkServiceDesignGroupsImpl( + NetworkServiceDesignGroupsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName); + return Utils.mapPage(inner, inner1 -> new NetworkServiceDesignGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, publisherName, context); + return Utils.mapPage(inner, inner1 -> new NetworkServiceDesignGroupImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + this.serviceClient().delete(resourceGroupName, publisherName, networkServiceDesignGroupName); + } + + public void delete( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, networkServiceDesignGroupName, context); + } + + public Response getWithResponse( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkServiceDesignGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkServiceDesignGroup get( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + NetworkServiceDesignGroupInner inner = + this.serviceClient().get(resourceGroupName, publisherName, networkServiceDesignGroupName); + if (inner != null) { + return new NetworkServiceDesignGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkServiceDesignGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + return this + .getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + return this.getWithResponse(resourceGroupName, publisherName, networkServiceDesignGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + this.delete(resourceGroupName, publisherName, networkServiceDesignGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + this.delete(resourceGroupName, publisherName, networkServiceDesignGroupName, context); + } + + private NetworkServiceDesignGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public NetworkServiceDesignGroupImpl define(String name) { + return new NetworkServiceDesignGroupImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionImpl.java new file mode 100644 index 000000000000..6b973bc31846 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersion; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class NetworkServiceDesignVersionImpl + implements NetworkServiceDesignVersion, NetworkServiceDesignVersion.Definition, NetworkServiceDesignVersion.Update { + private NetworkServiceDesignVersionInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 NetworkServiceDesignVersionPropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 NetworkServiceDesignVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publisherName; + + private String networkServiceDesignGroupName; + + private String networkServiceDesignVersionName; + + private TagsObject updateParameters; + + public NetworkServiceDesignVersionImpl withExistingNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + this.resourceGroupName = resourceGroupName; + this.publisherName = publisherName; + this.networkServiceDesignGroupName = networkServiceDesignGroupName; + return this; + } + + public NetworkServiceDesignVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .createOrUpdate( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.innerModel(), + Context.NONE); + return this; + } + + public NetworkServiceDesignVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .createOrUpdate( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.innerModel(), + context); + return this; + } + + NetworkServiceDesignVersionImpl( + String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new NetworkServiceDesignVersionInner(); + this.serviceManager = serviceManager; + this.networkServiceDesignVersionName = name; + } + + public NetworkServiceDesignVersionImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkServiceDesignVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .updateWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public NetworkServiceDesignVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .updateWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + updateParameters, + context) + .getValue(); + return this; + } + + NetworkServiceDesignVersionImpl( + NetworkServiceDesignVersionInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); + this.networkServiceDesignGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkServiceDesignGroups"); + this.networkServiceDesignVersionName = + Utils.getValueFromIdByName(innerObject.id(), "networkServiceDesignVersions"); + } + + public NetworkServiceDesignVersion refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + Context.NONE) + .getValue(); + return this; + } + + public NetworkServiceDesignVersion refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkServiceDesignVersions() + .getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context) + .getValue(); + return this; + } + + public NetworkServiceDesignVersionUpdateState updateState(NetworkServiceDesignVersionUpdateStateInner parameters) { + return serviceManager + .networkServiceDesignVersions() + .updateState( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters); + } + + public NetworkServiceDesignVersionUpdateState updateState( + NetworkServiceDesignVersionUpdateStateInner parameters, Context context) { + return serviceManager + .networkServiceDesignVersions() + .updateState( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context); + } + + public NetworkServiceDesignVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkServiceDesignVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkServiceDesignVersionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkServiceDesignVersionImpl withProperties(NetworkServiceDesignVersionPropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionUpdateStateImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionUpdateStateImpl.java new file mode 100644 index 000000000000..500033f86149 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionUpdateStateImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +public final class NetworkServiceDesignVersionUpdateStateImpl implements NetworkServiceDesignVersionUpdateState { + private NetworkServiceDesignVersionUpdateStateInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + NetworkServiceDesignVersionUpdateStateImpl( + NetworkServiceDesignVersionUpdateStateInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VersionState versionState() { + return this.innerModel().versionState(); + } + + public NetworkServiceDesignVersionUpdateStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsClientImpl.java new file mode 100644 index 000000000000..2209345a5be3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsClientImpl.java @@ -0,0 +1,2163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.NetworkServiceDesignVersionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 NetworkServiceDesignVersionsClient. */ +public final class NetworkServiceDesignVersionsClientImpl implements NetworkServiceDesignVersionsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkServiceDesignVersionsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkServiceDesignVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkServiceDesignVersionsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkServiceDesignVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientNetworkServiceDesignVersions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface NetworkServiceDesignVersionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @PathParam("networkServiceDesignVersionName") String networkServiceDesignVersionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @PathParam("networkServiceDesignVersionName") String networkServiceDesignVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkServiceDesignVersionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @PathParam("networkServiceDesignVersionName") String networkServiceDesignVersionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @PathParam("networkServiceDesignVersionName") String networkServiceDesignVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNetworkServiceDesignGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("networkServiceDesignGroupName") String networkServiceDesignGroupName, + @PathParam("networkServiceDesignVersionName") String networkServiceDesignVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkServiceDesignVersionUpdateStateInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNetworkServiceDesignGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + return this + .beginDeleteAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName) + .getSyncPoller(); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + return this + .beginDeleteAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context) + .getSyncPoller(); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + return beginDeleteAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + deleteAsync(resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName) + .block(); + } + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + deleteAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context) + .block(); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkServiceDesignVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignVersionInner.class, + NetworkServiceDesignVersionInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkServiceDesignVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignVersionInner.class, + NetworkServiceDesignVersionInner.class, + context); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkServiceDesignVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network service design version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkServiceDesignVersionInner> + beginCreateOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters) { + return createOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .block(); + } + + /** + * Creates or updates a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionInner createOrUpdate( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .block(); + } + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + return getWithResponseAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context) + .block(); + } + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionInner get( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + return getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + Context.NONE) + .getValue(); + } + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters) { + return updateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .block(); + } + + /** + * Updates a network service design version resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to the create or update network service design version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network service design version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionInner update( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + TagsObject parameters) { + return updateWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + Context.NONE) + .getValue(); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNetworkServiceDesignGroupSinglePageAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByNetworkServiceDesignGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + 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())); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNetworkServiceDesignGroupSinglePageAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNetworkServiceDesignGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNetworkServiceDesignGroupAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + return new PagedFlux<>( + () -> + listByNetworkServiceDesignGroupSinglePageAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName), + nextLink -> listByNetworkServiceDesignGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNetworkServiceDesignGroupAsync( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + return new PagedFlux<>( + () -> + listByNetworkServiceDesignGroupSinglePageAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, context), + nextLink -> listByNetworkServiceDesignGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + return new PagedIterable<>( + listByNetworkServiceDesignGroupAsync(resourceGroupName, publisherName, networkServiceDesignGroupName)); + } + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + return new PagedIterable<>( + listByNetworkServiceDesignGroupAsync( + resourceGroupName, publisherName, networkServiceDesignGroupName, context)); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (networkServiceDesignGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignGroupName is required and cannot be null.")); + } + if (networkServiceDesignVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkServiceDesignVersionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignVersionUpdateStateInner.class, + NetworkServiceDesignVersionUpdateStateInner.class, + this.client.getContext()); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkServiceDesignVersionUpdateStateInner.class, + NetworkServiceDesignVersionUpdateStateInner.class, + context); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + return this + .beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .getSyncPoller(); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, NetworkServiceDesignVersionUpdateStateInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + return this + .beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + return beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + return beginUpdateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + return updateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters) + .block(); + } + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkServiceDesignVersionUpdateStateInner updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + return updateStateAsync( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network service design versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNetworkServiceDesignGroupNextSinglePageAsync( + 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.listByNetworkServiceDesignGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network service design versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNetworkServiceDesignGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNetworkServiceDesignGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsImpl.java new file mode 100644 index 000000000000..792a9b624b8e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/NetworkServiceDesignVersionsImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkServiceDesignVersionsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersion; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionUpdateState; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersions; + +public final class NetworkServiceDesignVersionsImpl implements NetworkServiceDesignVersions { + private static final ClientLogger LOGGER = new ClientLogger(NetworkServiceDesignVersionsImpl.class); + + private final NetworkServiceDesignVersionsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public NetworkServiceDesignVersionsImpl( + NetworkServiceDesignVersionsClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + this + .serviceClient() + .delete(resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName); + } + + public void delete( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context); + } + + public Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkServiceDesignVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkServiceDesignVersion get( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName) { + NetworkServiceDesignVersionInner inner = + this + .serviceClient() + .get(resourceGroupName, publisherName, networkServiceDesignGroupName, networkServiceDesignVersionName); + if (inner != null) { + return new NetworkServiceDesignVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName) { + PagedIterable inner = + this + .serviceClient() + .listByNetworkServiceDesignGroup(resourceGroupName, publisherName, networkServiceDesignGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkServiceDesignVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByNetworkServiceDesignGroup( + resourceGroupName, publisherName, networkServiceDesignGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkServiceDesignVersionImpl(inner1, this.manager())); + } + + public NetworkServiceDesignVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters) { + NetworkServiceDesignVersionUpdateStateInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters); + if (inner != null) { + return new NetworkServiceDesignVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkServiceDesignVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context) { + NetworkServiceDesignVersionUpdateStateInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + context); + if (inner != null) { + return new NetworkServiceDesignVersionUpdateStateImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkServiceDesignVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + String networkServiceDesignVersionName = Utils.getValueFromIdByName(id, "networkServiceDesignVersions"); + if (networkServiceDesignVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkServiceDesignVersions'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + String networkServiceDesignVersionName = Utils.getValueFromIdByName(id, "networkServiceDesignVersions"); + if (networkServiceDesignVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkServiceDesignVersions'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + String networkServiceDesignVersionName = Utils.getValueFromIdByName(id, "networkServiceDesignVersions"); + if (networkServiceDesignVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkServiceDesignVersions'.", + id))); + } + this + .delete( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + String networkServiceDesignGroupName = Utils.getValueFromIdByName(id, "networkServiceDesignGroups"); + if (networkServiceDesignGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkServiceDesignGroups'.", + id))); + } + String networkServiceDesignVersionName = Utils.getValueFromIdByName(id, "networkServiceDesignVersions"); + if (networkServiceDesignVersionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkServiceDesignVersions'.", + id))); + } + this + .delete( + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + context); + } + + private NetworkServiceDesignVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public NetworkServiceDesignVersionImpl define(String name) { + return new NetworkServiceDesignVersionImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java index 83d4e87804f0..0eddb9e981c1 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationImpl.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.hybridnetwork.implementation; import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridnetwork.models.ActionType; import com.azure.resourcemanager.hybridnetwork.models.Operation; import com.azure.resourcemanager.hybridnetwork.models.OperationDisplay; +import com.azure.resourcemanager.hybridnetwork.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -23,10 +25,22 @@ 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; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java index d4905e9ed3d6..bc6f4bc2be61 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/OperationsClientImpl.java @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.hybridnetwork.fluent.OperationsClient; import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; -import com.azure.resourcemanager.hybridnetwork.models.OperationList; +import com.azure.resourcemanager.hybridnetwork.models.OperationListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -55,12 +55,12 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "HybridNetworkManagem") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.HybridNetwork/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -70,7 +70,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -201,7 +201,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @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) { @@ -238,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @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, Context context) { diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.java deleted file mode 100644 index 4f4fb352c11d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PreviewSubscriptionImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; - -public final class PreviewSubscriptionImpl - implements PreviewSubscription, PreviewSubscription.Definition, PreviewSubscription.Update { - private PreviewSubscriptionInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public PreviewSubscriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - private String vendorName; - - private String skuName; - - private String previewSubscription; - - public PreviewSubscriptionImpl withExistingVendorSku(String vendorName, String skuName) { - this.vendorName = vendorName; - this.skuName = skuName; - return this; - } - - public PreviewSubscription create() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), Context.NONE); - return this; - } - - public PreviewSubscription create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), context); - return this; - } - - PreviewSubscriptionImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = new PreviewSubscriptionInner(); - this.serviceManager = serviceManager; - this.previewSubscription = name; - } - - public PreviewSubscriptionImpl update() { - return this; - } - - public PreviewSubscription apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), Context.NONE); - return this; - } - - public PreviewSubscription apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .createOrUpdate(vendorName, skuName, previewSubscription, this.innerModel(), context); - return this; - } - - PreviewSubscriptionImpl( - PreviewSubscriptionInner innerObject, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); - this.skuName = Utils.getValueFromIdByName(innerObject.id(), "vendorSkus"); - this.previewSubscription = Utils.getValueFromIdByName(innerObject.id(), "previewSubscriptions"); - } - - public PreviewSubscription refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .getWithResponse(vendorName, skuName, previewSubscription, Context.NONE) - .getValue(); - return this; - } - - public PreviewSubscription refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkuPreviews() - .getWithResponse(vendorName, skuName, previewSubscription, context) - .getValue(); - return this; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactListOverviewImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactListOverviewImpl.java new file mode 100644 index 000000000000..d8caa6338bf2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactListOverviewImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactListOverview; + +public final class ProxyArtifactListOverviewImpl implements ProxyArtifactListOverview { + private ProxyArtifactListOverviewInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + ProxyArtifactListOverviewImpl( + ProxyArtifactListOverviewInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProxyArtifactListOverviewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactVersionsListOverviewImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactVersionsListOverviewImpl.java new file mode 100644 index 000000000000..bd2737d7f2f6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactVersionsListOverviewImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactOverviewPropertiesValue; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactVersionsListOverview; + +public final class ProxyArtifactVersionsListOverviewImpl implements ProxyArtifactVersionsListOverview { + private ProxyArtifactVersionsListOverviewInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + ProxyArtifactVersionsListOverviewImpl( + ProxyArtifactVersionsListOverviewInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProxyArtifactOverviewPropertiesValue properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProxyArtifactVersionsListOverviewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsClientImpl.java new file mode 100644 index 000000000000..c8108095dc4e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsClientImpl.java @@ -0,0 +1,1137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.ProxyArtifactsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactOverviewListResult; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactVersionsOverviewListResult; +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 ProxyArtifactsClient. */ +public final class ProxyArtifactsClientImpl implements ProxyArtifactsClient { + /** The proxy service used to perform REST calls. */ + private final ProxyArtifactsService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of ProxyArtifactsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProxyArtifactsClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(ProxyArtifactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientProxyArtifacts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface ProxyArtifactsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @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.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("artifactName") String artifactName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @PathParam("artifactStoreName") String artifactStoreName, + @QueryParam("artifactName") String artifactName, + @PathParam("artifactVersionName") String artifactVersionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArtifactChangeState parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required 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(), + resourceGroupName, + publisherName, + artifactStoreName, + 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())); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + 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)); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String publisherName, String artifactStoreName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, publisherName, artifactStoreName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, publisherName, artifactStoreName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName) { + return new PagedIterable<>(listAsync(resourceGroupName, publisherName, artifactStoreName)); + } + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, publisherName, artifactStoreName, context)); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactName == null) { + return Mono.error(new IllegalArgumentException("Parameter artifactName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + 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())); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactName == null) { + return Mono.error(new IllegalArgumentException("Parameter artifactName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + 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)); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName) { + return new PagedFlux<>( + () -> getSinglePageAsync(resourceGroupName, publisherName, artifactStoreName, artifactName), + nextLink -> getNextSinglePageAsync(nextLink)); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + Context context) { + return new PagedFlux<>( + () -> getSinglePageAsync(resourceGroupName, publisherName, artifactStoreName, artifactName, context), + nextLink -> getNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName) { + return new PagedIterable<>(getAsync(resourceGroupName, publisherName, artifactStoreName, artifactName)); + } + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + Context context) { + return new PagedIterable<>( + getAsync(resourceGroupName, publisherName, artifactStoreName, artifactName, context)); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactName == null) { + return Mono.error(new IllegalArgumentException("Parameter artifactName is required and cannot be null.")); + } + if (artifactVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateStateWithResponseAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (artifactStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactStoreName is required and cannot be null.")); + } + if (artifactName == null) { + return Mono.error(new IllegalArgumentException("Parameter artifactName is required and cannot be null.")); + } + if (artifactVersionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter artifactVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateState( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProxyArtifactVersionsListOverviewInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProxyArtifactVersionsListOverviewInner.class, + ProxyArtifactVersionsListOverviewInner.class, + this.client.getContext()); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProxyArtifactVersionsListOverviewInner> + beginUpdateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateStateWithResponseAsync( + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProxyArtifactVersionsListOverviewInner.class, + ProxyArtifactVersionsListOverviewInner.class, + context); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProxyArtifactVersionsListOverviewInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + return this + .beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters) + .getSyncPoller(); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProxyArtifactVersionsListOverviewInner> + beginUpdateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + return this + .beginUpdateStateAsync( + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + return beginUpdateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateStateAsync( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + return beginUpdateStateAsync( + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProxyArtifactVersionsListOverviewInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + return updateStateAsync( + resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters) + .block(); + } + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProxyArtifactVersionsListOverviewInner updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + return updateStateAsync( + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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.getNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsImpl.java new file mode 100644 index 000000000000..df4f294f415b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/ProxyArtifactsImpl.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.ProxyArtifactsClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactListOverview; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactVersionsListOverview; +import com.azure.resourcemanager.hybridnetwork.models.ProxyArtifacts; + +public final class ProxyArtifactsImpl implements ProxyArtifacts { + private static final ClientLogger LOGGER = new ClientLogger(ProxyArtifactsImpl.class); + + private final ProxyArtifactsClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public ProxyArtifactsImpl( + ProxyArtifactsClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, publisherName, artifactStoreName); + return Utils.mapPage(inner, inner1 -> new ProxyArtifactListOverviewImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, publisherName, artifactStoreName, context); + return Utils.mapPage(inner, inner1 -> new ProxyArtifactListOverviewImpl(inner1, this.manager())); + } + + public PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName) { + PagedIterable inner = + this.serviceClient().get(resourceGroupName, publisherName, artifactStoreName, artifactName); + return Utils.mapPage(inner, inner1 -> new ProxyArtifactVersionsListOverviewImpl(inner1, this.manager())); + } + + public PagedIterable get( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + Context context) { + PagedIterable inner = + this.serviceClient().get(resourceGroupName, publisherName, artifactStoreName, artifactName, context); + return Utils.mapPage(inner, inner1 -> new ProxyArtifactVersionsListOverviewImpl(inner1, this.manager())); + } + + public ProxyArtifactVersionsListOverview updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters) { + ProxyArtifactVersionsListOverviewInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, publisherName, artifactStoreName, artifactName, artifactVersionName, parameters); + if (inner != null) { + return new ProxyArtifactVersionsListOverviewImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProxyArtifactVersionsListOverview updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context) { + ProxyArtifactVersionsListOverviewInner inner = + this + .serviceClient() + .updateState( + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + context); + if (inner != null) { + return new ProxyArtifactVersionsListOverviewImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProxyArtifactsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublisherImpl.java similarity index 59% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublisherImpl.java index 21ad605b401f..6556e54014cf 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DeviceImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublisherImpl.java @@ -4,20 +4,19 @@ package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.models.Device; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; -import com.azure.resourcemanager.hybridnetwork.models.DeviceRegistrationKey; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; +import com.azure.resourcemanager.hybridnetwork.models.Publisher; +import com.azure.resourcemanager.hybridnetwork.models.PublisherPropertiesFormat; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; import java.util.Collections; import java.util.Map; -public final class DeviceImpl implements Device, Device.Definition, Device.Update { - private DeviceInner innerObject; +public final class PublisherImpl implements Publisher, Publisher.Definition, Publisher.Update { + private PublisherInner innerObject; private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; @@ -46,10 +45,14 @@ public Map tags() { } } - public DevicePropertiesFormat properties() { + public PublisherPropertiesFormat properties() { return this.innerModel().properties(); } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -66,7 +69,7 @@ public String resourceGroupName() { return resourceGroupName; } - public DeviceInner innerModel() { + public PublisherInner innerModel() { return this.innerObject; } @@ -76,110 +79,103 @@ private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { private String resourceGroupName; - private String deviceName; + private String publisherName; private TagsObject updateParameters; - public DeviceImpl withExistingResourceGroup(String resourceGroupName) { + public PublisherImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; } - public Device create() { + public Publisher create() { this.innerObject = serviceManager .serviceClient() - .getDevices() - .createOrUpdate(resourceGroupName, deviceName, this.innerModel(), Context.NONE); + .getPublishers() + .createOrUpdate(resourceGroupName, publisherName, this.innerModel(), Context.NONE); return this; } - public Device create(Context context) { + public Publisher create(Context context) { this.innerObject = serviceManager .serviceClient() - .getDevices() - .createOrUpdate(resourceGroupName, deviceName, this.innerModel(), context); + .getPublishers() + .createOrUpdate(resourceGroupName, publisherName, this.innerModel(), context); return this; } - DeviceImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = new DeviceInner(); + PublisherImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new PublisherInner(); this.serviceManager = serviceManager; - this.deviceName = name; + this.publisherName = name; } - public DeviceImpl update() { + public PublisherImpl update() { this.updateParameters = new TagsObject(); return this; } - public Device apply() { + public Publisher apply() { this.innerObject = serviceManager .serviceClient() - .getDevices() - .updateTagsWithResponse(resourceGroupName, deviceName, updateParameters, Context.NONE) + .getPublishers() + .updateWithResponse(resourceGroupName, publisherName, updateParameters, Context.NONE) .getValue(); return this; } - public Device apply(Context context) { + public Publisher apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getDevices() - .updateTagsWithResponse(resourceGroupName, deviceName, updateParameters, context) + .getPublishers() + .updateWithResponse(resourceGroupName, publisherName, updateParameters, context) .getValue(); return this; } - DeviceImpl(DeviceInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + PublisherImpl( + PublisherInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "devices"); + this.publisherName = Utils.getValueFromIdByName(innerObject.id(), "publishers"); } - public Device refresh() { + public Publisher refresh() { this.innerObject = serviceManager .serviceClient() - .getDevices() - .getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE) + .getPublishers() + .getByResourceGroupWithResponse(resourceGroupName, publisherName, Context.NONE) .getValue(); return this; } - public Device refresh(Context context) { + public Publisher refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getDevices() - .getByResourceGroupWithResponse(resourceGroupName, deviceName, context) + .getPublishers() + .getByResourceGroupWithResponse(resourceGroupName, publisherName, context) .getValue(); return this; } - public Response listRegistrationKeyWithResponse(Context context) { - return serviceManager.devices().listRegistrationKeyWithResponse(resourceGroupName, deviceName, context); - } - - public DeviceRegistrationKey listRegistrationKey() { - return serviceManager.devices().listRegistrationKey(resourceGroupName, deviceName); - } - - public DeviceImpl withRegion(Region location) { + public PublisherImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; } - public DeviceImpl withRegion(String location) { + public PublisherImpl withRegion(String location) { this.innerModel().withLocation(location); return this; } - public DeviceImpl withTags(Map tags) { + public PublisherImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); return this; @@ -189,11 +185,16 @@ public DeviceImpl withTags(Map tags) { } } - public DeviceImpl withProperties(DevicePropertiesFormat properties) { + public PublisherImpl withProperties(PublisherPropertiesFormat properties) { this.innerModel().withProperties(properties); return this; } + public PublisherImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersClientImpl.java new file mode 100644 index 000000000000..7deb586e0604 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersClientImpl.java @@ -0,0 +1,1457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.PublishersClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner; +import com.azure.resourcemanager.hybridnetwork.models.PublisherListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 PublishersClient. */ +public final class PublishersClientImpl implements PublishersClient { + /** The proxy service used to perform REST calls. */ + private final PublishersService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of PublishersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublishersClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(PublishersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientPublishers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface PublishersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers") + @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}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @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.HybridNetwork/publishers/{publisherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PublisherInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the publishers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers 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())); + } + + /** + * Lists all the publishers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the publishers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the publishers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the publishers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the publishers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the publishers in a 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 a list of publishers 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + 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())); + } + + /** + * Lists all the publishers in a 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 a list of publishers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + 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)); + } + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, publisherName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisherName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, publisherName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName) { + return this.beginDeleteAsync(resourceGroupName, publisherName).getSyncPoller(); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 publisherName, Context context) { + return this.beginDeleteAsync(resourceGroupName, publisherName, context).getSyncPoller(); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName) { + return beginDeleteAsync(resourceGroupName, publisherName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publisherName, Context context) { + return beginDeleteAsync(resourceGroupName, publisherName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName) { + deleteAsync(resourceGroupName, publisherName).block(); + } + + /** + * Deletes the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publisherName, Context context) { + deleteAsync(resourceGroupName, publisherName, context).block(); + } + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String publisherName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publisherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publisherName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publisherName, context).block(); + } + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner getByResourceGroup(String resourceGroupName, String publisherName) { + return getByResourceGroupWithResponse(resourceGroupName, publisherName, Context.NONE).getValue(); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publisherName, PublisherInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublisherInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publisherName, PublisherInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PublisherInner.class, + PublisherInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublisherInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publisherName) { + final PublisherInner parameters = null; + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PublisherInner.class, + PublisherInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublisherInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publisherName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PublisherInner.class, PublisherInner.class, context); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublisherInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName) { + final PublisherInner parameters = null; + return this.beginCreateOrUpdateAsync(resourceGroupName, publisherName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of publisher resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublisherInner> beginCreateOrUpdate( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, publisherName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publisherName, PublisherInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String publisherName) { + final PublisherInner parameters = null; + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publisherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner createOrUpdate(String resourceGroupName, String publisherName) { + final PublisherInner parameters = null; + return createOrUpdateAsync(resourceGroupName, publisherName, parameters).block(); + } + + /** + * Creates or updates a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner createOrUpdate( + String resourceGroupName, String publisherName, PublisherInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, publisherName, parameters, context).block(); + } + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String publisherName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String publisherName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + publisherName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String publisherName) { + final TagsObject parameters = null; + return updateWithResponseAsync(resourceGroupName, publisherName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param parameters Parameters supplied to the create publisher operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String publisherName, TagsObject parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, publisherName, parameters, context).block(); + } + + /** + * Update a publisher resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner update(String resourceGroupName, String publisherName) { + final TagsObject parameters = null; + return updateWithResponse(resourceGroupName, publisherName, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of publishers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersImpl.java new file mode 100644 index 000000000000..d2944826d766 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/PublishersImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.PublishersClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner; +import com.azure.resourcemanager.hybridnetwork.models.Publisher; +import com.azure.resourcemanager.hybridnetwork.models.Publishers; + +public final class PublishersImpl implements Publishers { + private static final ClientLogger LOGGER = new ClientLogger(PublishersImpl.class); + + private final PublishersClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public PublishersImpl( + PublishersClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String publisherName) { + this.serviceClient().delete(resourceGroupName, publisherName); + } + + public void delete(String resourceGroupName, String publisherName, Context context) { + this.serviceClient().delete(resourceGroupName, publisherName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publisherName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublisherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Publisher getByResourceGroup(String resourceGroupName, String publisherName) { + PublisherInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, publisherName); + if (inner != null) { + return new PublisherImpl(inner, this.manager()); + } else { + return null; + } + } + + public Publisher getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publisherName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publisherName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + this.delete(resourceGroupName, publisherName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publisherName = Utils.getValueFromIdByName(id, "publishers"); + if (publisherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publishers'.", id))); + } + this.delete(resourceGroupName, publisherName, context); + } + + private PublishersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public PublisherImpl define(String name) { + return new PublisherImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java deleted file mode 100644 index ccc524b1e564..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesClientImpl.java +++ /dev/null @@ -1,1416 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.RoleInstancesClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleInstanceListResult; -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 RoleInstancesClient. */ -public final class RoleInstancesClientImpl implements RoleInstancesClient { - /** The proxy service used to perform REST calls. */ - private final RoleInstancesService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of RoleInstancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RoleInstancesClientImpl(HybridNetworkManagementClientImpl client) { - this.service = - RestProxy.create(RoleInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientRoleInstances to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface RoleInstancesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @PathParam("roleInstanceName") String roleInstanceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @PathParam("roleInstanceName") String roleInstanceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @PathParam("roleInstanceName") String roleInstanceName, - @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.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances/{roleInstanceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @PathParam("roleInstanceName") String roleInstanceName, - @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.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}/roleInstances") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @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); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> startWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 - .start( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> startWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginStartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - Mono>> mono = - startWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginStartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginStart( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginStart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 startAsync(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 startAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginStartAsync(locationName, vendorName, serviceKey, roleInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 start(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - startAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); - } - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 start( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - startAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> stopWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 - .stop( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> stopWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginStopAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - Mono>> mono = - stopWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginStopAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginStop( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginStop( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 stopAsync(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 stopAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginStopAsync(locationName, vendorName, serviceKey, roleInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 stop(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - stopAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); - } - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 stop( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - stopAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> restartWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 - .restart( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> restartWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginRestartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - Mono>> mono = - restartWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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> beginRestartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginRestart( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName).getSyncPoller(); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginRestart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).getSyncPoller(); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return beginRestartAsync(locationName, vendorName, serviceKey, roleInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 restart(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - restartAsync(locationName, vendorName, serviceKey, roleInstanceName).block(); - } - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 restart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - restartAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); - } - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 - .get( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (roleInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - roleInstanceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return getWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - return getWithResponseAsync(locationName, vendorName, serviceKey, roleInstanceName, context).block(); - } - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RoleInstanceInner get(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - return getWithResponse(locationName, vendorName, serviceKey, roleInstanceName, Context.NONE).getValue(); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String vendorName, String serviceKey) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required 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(), - locationName, - vendorName, - serviceKey, - 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())); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String vendorName, String serviceKey, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - 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)); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String vendorName, String serviceKey) { - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, vendorName, serviceKey), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String locationName, String vendorName, String serviceKey, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, vendorName, serviceKey, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String vendorName, String serviceKey) { - return new PagedIterable<>(listAsync(locationName, vendorName, serviceKey)); - } - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String locationName, String vendorName, String serviceKey, Context context) { - return new PagedIterable<>(listAsync(locationName, vendorName, serviceKey, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java deleted file mode 100644 index 3602cb2f2ae6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/RoleInstancesImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.RoleInstancesClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; -import com.azure.resourcemanager.hybridnetwork.models.RoleInstance; -import com.azure.resourcemanager.hybridnetwork.models.RoleInstances; - -public final class RoleInstancesImpl implements RoleInstances { - private static final ClientLogger LOGGER = new ClientLogger(RoleInstancesImpl.class); - - private final RoleInstancesClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public RoleInstancesImpl( - RoleInstancesClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void start(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - this.serviceClient().start(locationName, vendorName, serviceKey, roleInstanceName); - } - - public void start( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - this.serviceClient().start(locationName, vendorName, serviceKey, roleInstanceName, context); - } - - public void stop(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - this.serviceClient().stop(locationName, vendorName, serviceKey, roleInstanceName); - } - - public void stop( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - this.serviceClient().stop(locationName, vendorName, serviceKey, roleInstanceName, context); - } - - public void restart(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - this.serviceClient().restart(locationName, vendorName, serviceKey, roleInstanceName); - } - - public void restart( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - this.serviceClient().restart(locationName, vendorName, serviceKey, roleInstanceName, context); - } - - public Response getWithResponse( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context) { - Response inner = - this.serviceClient().getWithResponse(locationName, vendorName, serviceKey, roleInstanceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RoleInstanceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RoleInstance get(String locationName, String vendorName, String serviceKey, String roleInstanceName) { - RoleInstanceInner inner = this.serviceClient().get(locationName, vendorName, serviceKey, roleInstanceName); - if (inner != null) { - return new RoleInstanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String locationName, String vendorName, String serviceKey) { - PagedIterable inner = this.serviceClient().list(locationName, vendorName, serviceKey); - return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String locationName, String vendorName, String serviceKey, Context context) { - PagedIterable inner = - this.serviceClient().list(locationName, vendorName, serviceKey, context); - return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); - } - - private RoleInstancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteImpl.java new file mode 100644 index 000000000000..8b9337c6b96f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteImpl.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.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.hybridnetwork.models.Site; +import com.azure.resourcemanager.hybridnetwork.models.SitePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SiteImpl implements Site, Site.Definition, Site.Update { + private SiteInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 SitePropertiesFormat properties() { + return this.innerModel().properties(); + } + + 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 SiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String siteName; + + private TagsObject updateParameters; + + public SiteImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Site create() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .createOrUpdate(resourceGroupName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public Site create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .createOrUpdate(resourceGroupName, siteName, this.innerModel(), context); + return this; + } + + SiteImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new SiteInner(); + this.serviceManager = serviceManager; + this.siteName = name; + } + + public SiteImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Site apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .updateTagsWithResponse(resourceGroupName, siteName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Site apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .updateTagsWithResponse(resourceGroupName, siteName, updateParameters, context) + .getValue(); + return this; + } + + SiteImpl(SiteInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.siteName = Utils.getValueFromIdByName(innerObject.id(), "sites"); + } + + public Site refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .getByResourceGroupWithResponse(resourceGroupName, siteName, Context.NONE) + .getValue(); + return this; + } + + public Site refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .getByResourceGroupWithResponse(resourceGroupName, siteName, context) + .getValue(); + return this; + } + + public SiteImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SiteImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SiteImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SiteImpl withProperties(SitePropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServiceImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServiceImpl.java new file mode 100644 index 000000000000..e5aca8db20c0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServiceImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkService; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServicePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.Sku; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SiteNetworkServiceImpl + implements SiteNetworkService, SiteNetworkService.Definition, SiteNetworkService.Update { + private SiteNetworkServiceInner innerObject; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager 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 SiteNetworkServicePropertiesFormat 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 SiteNetworkServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String siteNetworkServiceName; + + private TagsObject updateParameters; + + public SiteNetworkServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SiteNetworkService create() { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .createOrUpdate(resourceGroupName, siteNetworkServiceName, this.innerModel(), Context.NONE); + return this; + } + + public SiteNetworkService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .createOrUpdate(resourceGroupName, siteNetworkServiceName, this.innerModel(), context); + return this; + } + + SiteNetworkServiceImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = new SiteNetworkServiceInner(); + this.serviceManager = serviceManager; + this.siteNetworkServiceName = name; + } + + public SiteNetworkServiceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public SiteNetworkService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .updateTagsWithResponse(resourceGroupName, siteNetworkServiceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SiteNetworkService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .updateTagsWithResponse(resourceGroupName, siteNetworkServiceName, updateParameters, context) + .getValue(); + return this; + } + + SiteNetworkServiceImpl( + SiteNetworkServiceInner innerObject, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.siteNetworkServiceName = Utils.getValueFromIdByName(innerObject.id(), "siteNetworkServices"); + } + + public SiteNetworkService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, Context.NONE) + .getValue(); + return this; + } + + public SiteNetworkService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSiteNetworkServices() + .getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, context) + .getValue(); + return this; + } + + public SiteNetworkServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SiteNetworkServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SiteNetworkServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SiteNetworkServiceImpl withProperties(SiteNetworkServicePropertiesFormat properties) { + this.innerModel().withProperties(properties); + return this; + } + + public SiteNetworkServiceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public SiteNetworkServiceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesClientImpl.java new file mode 100644 index 000000000000..37264b5e685f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesClientImpl.java @@ -0,0 +1,1460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridnetwork.fluent.SiteNetworkServicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServiceListResult; +import com.azure.resourcemanager.hybridnetwork.models.TagsObject; +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 SiteNetworkServicesClient. */ +public final class SiteNetworkServicesClientImpl implements SiteNetworkServicesClient { + /** The proxy service used to perform REST calls. */ + private final SiteNetworkServicesService service; + + /** The service client containing this operation class. */ + private final HybridNetworkManagementClientImpl client; + + /** + * Initializes an instance of SiteNetworkServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SiteNetworkServicesClientImpl(HybridNetworkManagementClientImpl client) { + this.service = + RestProxy.create(SiteNetworkServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridNetworkManagementClientSiteNetworkServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridNetworkManagem") + public interface SiteNetworkServicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("siteNetworkServiceName") String siteNetworkServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("siteNetworkServiceName") String siteNetworkServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("siteNetworkServiceName") String siteNetworkServiceName, + @BodyParam("application/json") SiteNetworkServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("siteNetworkServiceName") String siteNetworkServiceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices") + @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}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices") + @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("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 siteNetworkServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 siteNetworkServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + accept, + context); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 siteNetworkServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, siteNetworkServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 siteNetworkServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, siteNetworkServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 siteNetworkServiceName) { + return this.beginDeleteAsync(resourceGroupName, siteNetworkServiceName).getSyncPoller(); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 siteNetworkServiceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, siteNetworkServiceName, context).getSyncPoller(); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 siteNetworkServiceName) { + return beginDeleteAsync(resourceGroupName, siteNetworkServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 siteNetworkServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, siteNetworkServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 siteNetworkServiceName) { + deleteAsync(resourceGroupName, siteNetworkServiceName).block(); + } + + /** + * Deletes the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 siteNetworkServiceName, Context context) { + deleteAsync(resourceGroupName, siteNetworkServiceName, context).block(); + } + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + accept, + context); + } + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String siteNetworkServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, siteNetworkServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String siteNetworkServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, siteNetworkServiceName, context).block(); + } + + /** + * Gets information about the specified site network service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified site network service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteNetworkServiceInner getByResourceGroup(String resourceGroupName, String siteNetworkServiceName) { + return getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, Context.NONE).getValue(); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + parameters, + accept, + context); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SiteNetworkServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, siteNetworkServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SiteNetworkServiceInner.class, + SiteNetworkServiceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SiteNetworkServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, siteNetworkServiceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SiteNetworkServiceInner.class, + SiteNetworkServiceInner.class, + context); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SiteNetworkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site network service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SiteNetworkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteNetworkServiceInner createOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters).block(); + } + + /** + * Creates or updates a network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to the create or update site network service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteNetworkServiceInner createOrUpdate( + String resourceGroupName, String siteNetworkServiceName, SiteNetworkServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, siteNetworkServiceName, parameters, context).block(); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteNetworkServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter siteNetworkServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + siteNetworkServiceName, + parameters, + accept, + context); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, siteNetworkServiceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, siteNetworkServiceName, parameters, context).block(); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteNetworkServiceName The name of the site network service. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site network service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteNetworkServiceInner updateTags( + String resourceGroupName, String siteNetworkServiceName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, siteNetworkServiceName, parameters, Context.NONE).getValue(); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call 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())); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all sites in the network service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call 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())); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all site network services. + * + * @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 response for site network services API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for site network services API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesImpl.java new file mode 100644 index 000000000000..5b53cd8d5f5c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SiteNetworkServicesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.SiteNetworkServicesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkService; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServices; + +public final class SiteNetworkServicesImpl implements SiteNetworkServices { + private static final ClientLogger LOGGER = new ClientLogger(SiteNetworkServicesImpl.class); + + private final SiteNetworkServicesClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public SiteNetworkServicesImpl( + SiteNetworkServicesClient innerClient, + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String siteNetworkServiceName) { + this.serviceClient().delete(resourceGroupName, siteNetworkServiceName); + } + + public void delete(String resourceGroupName, String siteNetworkServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, siteNetworkServiceName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String siteNetworkServiceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SiteNetworkServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SiteNetworkService getByResourceGroup(String resourceGroupName, String siteNetworkServiceName) { + SiteNetworkServiceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, siteNetworkServiceName); + if (inner != null) { + return new SiteNetworkServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SiteNetworkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SiteNetworkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SiteNetworkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SiteNetworkServiceImpl(inner1, this.manager())); + } + + public SiteNetworkService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteNetworkServiceName = Utils.getValueFromIdByName(id, "siteNetworkServices"); + if (siteNetworkServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'siteNetworkServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteNetworkServiceName = Utils.getValueFromIdByName(id, "siteNetworkServices"); + if (siteNetworkServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'siteNetworkServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, siteNetworkServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteNetworkServiceName = Utils.getValueFromIdByName(id, "siteNetworkServices"); + if (siteNetworkServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'siteNetworkServices'.", id))); + } + this.delete(resourceGroupName, siteNetworkServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteNetworkServiceName = Utils.getValueFromIdByName(id, "siteNetworkServices"); + if (siteNetworkServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'siteNetworkServices'.", id))); + } + this.delete(resourceGroupName, siteNetworkServiceName, context); + } + + private SiteNetworkServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public SiteNetworkServiceImpl define(String name) { + return new SiteNetworkServiceImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesClientImpl.java similarity index 67% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesClientImpl.java index 3517bb31fa3b..418b2a97d05b 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/DevicesClientImpl.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesClientImpl.java @@ -14,7 +14,6 @@ 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; @@ -33,107 +32,102 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.DevicesClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; -import com.azure.resourcemanager.hybridnetwork.models.DeviceListResult; +import com.azure.resourcemanager.hybridnetwork.fluent.SitesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.hybridnetwork.models.SiteListResult; import com.azure.resourcemanager.hybridnetwork.models.TagsObject; 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 DevicesClient. */ -public final class DevicesClientImpl implements DevicesClient { +/** An instance of this class provides access to all the operations defined in SitesClient. */ +public final class SitesClientImpl implements SitesClient { /** The proxy service used to perform REST calls. */ - private final DevicesService service; + private final SitesService service; /** The service client containing this operation class. */ private final HybridNetworkManagementClientImpl client; /** - * Initializes an instance of DevicesClientImpl. + * Initializes an instance of SitesClientImpl. * * @param client the instance of the service client containing this operation class. */ - DevicesClientImpl(HybridNetworkManagementClientImpl client) { - this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + SitesClientImpl(HybridNetworkManagementClientImpl client) { + this.service = RestProxy.create(SitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridNetworkManagementClientDevices to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for HybridNetworkManagementClientSites to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "HybridNetworkManagem") - private interface DevicesService { + public interface SitesService { @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices/{deviceName}") - @ExpectedResponses({200, 202, 204}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") + @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deviceName") String deviceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @PathParam("siteName") String siteName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices/{deviceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deviceName") String deviceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @PathParam("siteName") String siteName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices/{deviceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deviceName") String deviceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeviceInner parameters, + @PathParam("siteName") String siteName, + @BodyParam("application/json") SiteInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices/{deviceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateTags( + Mono> updateTags( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deviceName") String deviceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @PathParam("siteName") String siteName, @BodyParam("application/json") TagsObject parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/devices") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -142,30 +136,14 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork" - + "/devices/{deviceName}/listRegistrationKey") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRegistrationKey( - @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deviceName") String deviceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -173,7 +151,7 @@ Mono> listRegistrationKey( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -183,7 +161,7 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -191,36 +169,36 @@ Mono> listByResourceGroupNext( } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deviceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String siteName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -228,20 +206,20 @@ private Mono>> deleteWithResponseAsync(String resource service .delete( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,52 +228,52 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String deviceName, Context context) { + String resourceGroupName, String siteName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, accept, context); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deviceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String siteName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, siteName); return this .client .getLroResult( @@ -303,10 +281,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -315,34 +293,34 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String deviceName, Context context) { + String resourceGroupName, String siteName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, siteName, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 deviceName) { - return beginDeleteAsync(resourceGroupName, deviceName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String siteName) { + return this.beginDeleteAsync(resourceGroupName, siteName).getSyncPoller(); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -350,31 +328,30 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String deviceName, Context context) { - return beginDeleteAsync(resourceGroupName, deviceName, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String siteName, Context context) { + return this.beginDeleteAsync(resourceGroupName, siteName, context).getSyncPoller(); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deviceName) { - return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String siteName) { + return beginDeleteAsync(resourceGroupName, siteName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -382,74 +359,73 @@ private Mono deleteAsync(String resourceGroupName, String deviceName) { * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deviceName, Context context) { - return beginDeleteAsync(resourceGroupName, deviceName, context) + private Mono deleteAsync(String resourceGroupName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, siteName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 deviceName) { - deleteAsync(resourceGroupName, deviceName).block(); + public void delete(String resourceGroupName, String siteName) { + deleteAsync(resourceGroupName, siteName).block(); } /** - * Deletes the specified device. + * Deletes the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 deviceName, Context context) { - deleteAsync(resourceGroupName, deviceName, context).block(); + public void delete(String resourceGroupName, String siteName, Context context) { + deleteAsync(resourceGroupName, siteName, context).block(); } /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device along with {@link Response} on successful completion of {@link - * Mono}. + * @return information about the specified network site along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String deviceName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String siteName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -457,143 +433,143 @@ private Mono> getByResourceGroupWithResponseAsync( service .getByResourceGroup( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device along with {@link Response} on successful completion of {@link - * Mono}. + * @return information about the specified network site along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String deviceName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String siteName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, accept, context); } /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device on successful completion of {@link Mono}. + * @return information about the specified network site on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String deviceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName) + private Mono getByResourceGroupAsync(String resourceGroupName, String siteName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, siteName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device along with {@link Response}. + * @return information about the specified network site along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String deviceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName, context).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String siteName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, siteName, context).block(); } /** - * Gets information about the specified device. + * Gets information about the specified network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device. + * @return information about the specified network site. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner getByResourceGroup(String resourceGroupName, String deviceName) { - return getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); + public SiteInner getByResourceGroup(String resourceGroupName, String siteName) { + return getByResourceGroupWithResponse(resourceGroupName, siteName, Context.NONE).getValue(); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response} on successful completion of {@link Mono}. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String deviceName, DeviceInner parameters) { + String resourceGroupName, String siteName, SiteInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -606,10 +582,10 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, parameters, accept, context)) @@ -617,39 +593,39 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response} on successful completion of {@link Mono}. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + String resourceGroupName, String siteName, SiteInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -660,201 +636,200 @@ private Mono>> createOrUpdateWithResponseAsync( return service .createOrUpdate( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, parameters, accept, context); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 device resource. + * @return the {@link PollerFlux} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deviceName, DeviceInner parameters) { + private PollerFlux, SiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String siteName, SiteInner parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, deviceName, parameters); + createOrUpdateWithResponseAsync(resourceGroupName, siteName, parameters); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, this.client.getContext()); + .getLroResult( + mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, this.client.getContext()); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of device resource. + * @return the {@link PollerFlux} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { + private PollerFlux, SiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String siteName, SiteInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, deviceName, parameters, context); + createOrUpdateWithResponseAsync(resourceGroupName, siteName, parameters, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, context); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of device resource. + * @return the {@link SyncPoller} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, String deviceName, DeviceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters).getSyncPoller(); + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String siteName, SiteInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, siteName, parameters).getSyncPoller(); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of device resource. + * @return the {@link SyncPoller} for polling of site resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters, context).getSyncPoller(); + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String siteName, SiteInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, siteName, parameters, context).getSyncPoller(); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource on successful completion of {@link Mono}. + * @return site resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, DeviceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters) + private Mono createOrUpdateAsync(String resourceGroupName, String siteName, SiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, siteName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource on successful completion of {@link Mono}. + * @return site resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deviceName, parameters, context) + private Mono createOrUpdateAsync( + String resourceGroupName, String siteName, SiteInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, siteName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner createOrUpdate(String resourceGroupName, String deviceName, DeviceInner parameters) { - return createOrUpdateAsync(resourceGroupName, deviceName, parameters).block(); + public SiteInner createOrUpdate(String resourceGroupName, String siteName, SiteInner parameters) { + return createOrUpdateAsync(resourceGroupName, siteName, parameters).block(); } /** - * Creates or updates a device. + * Creates or updates a network site. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName Resource name for the device resource. - * @param parameters Parameters supplied to the create or update device operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to the create or update network site operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner createOrUpdate( - String resourceGroupName, String deviceName, DeviceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, deviceName, parameters, context).block(); + public SiteInner createOrUpdate(String resourceGroupName, String siteName, SiteInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, siteName, parameters, context).block(); } /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response} on successful completion of {@link Mono}. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync( - String resourceGroupName, String deviceName, TagsObject parameters) { + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String siteName, TagsObject parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -867,10 +842,10 @@ private Mono> updateTagsWithResponseAsync( service .updateTags( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, parameters, accept, context)) @@ -878,39 +853,39 @@ private Mono> updateTagsWithResponseAsync( } /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response} on successful completion of {@link Mono}. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync( - String resourceGroupName, String deviceName, TagsObject parameters, Context context) { + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String siteName, TagsObject parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { @@ -921,76 +896,76 @@ private Mono> updateTagsWithResponseAsync( return service .updateTags( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, - deviceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), + siteName, parameters, accept, context); } /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource on successful completion of {@link Mono}. + * @return site resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync(String resourceGroupName, String deviceName, TagsObject parameters) { - return updateTagsWithResponseAsync(resourceGroupName, deviceName, parameters) + private Mono updateTagsAsync(String resourceGroupName, String siteName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, siteName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource along with {@link Response}. + * @return site resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String deviceName, TagsObject parameters, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, deviceName, parameters, context).block(); + public Response updateTagsWithResponse( + String resourceGroupName, String siteName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, siteName, parameters, context).block(); } /** - * Updates device tags. + * Updates a site update tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param parameters Parameters supplied to the update device tags operation. + * @param siteName The name of the network service site. + * @param parameters Parameters supplied to update network site tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return device resource. + * @return site resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner updateTags(String resourceGroupName, String deviceName, TagsObject parameters) { - return updateTagsWithResponse(resourceGroupName, deviceName, parameters, Context.NONE).getValue(); + public SiteInner updateTags(String resourceGroupName, String siteName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, siteName, parameters, Context.NONE).getValue(); } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1014,7 +989,7 @@ private Mono> listSinglePageAsync() { this.client.getSubscriptionId(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1027,17 +1002,17 @@ private Mono> listSinglePageAsync() { } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1071,87 +1046,87 @@ private Mono> listSinglePageAsync(Context context) { } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedFlux}. + * @return response for sites API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>( () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedFlux}. + * @return response for sites API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.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( @@ -1159,12 +1134,12 @@ private Mono> listByResourceGroupSinglePageAsync(Stri service .listByResourceGroup( this.client.getEndpoint(), - resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1177,18 +1152,18 @@ private Mono> listByResourceGroupSinglePageAsync(Stri } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( + private Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1196,24 +1171,24 @@ private Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), - resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accept, context) .map( @@ -1228,209 +1203,67 @@ private Mono> listByResourceGroupSinglePageAsync( } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedFlux}. + * @return response for sites API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedFlux}. + * @return response for sites API service call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { + public PagedIterable listByResourceGroup(String resourceGroupName) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Lists all the device resource in a resource group. + * Lists all sites in the network service. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRegistrationKeyWithResponseAsync( - String resourceGroupName, String deviceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required 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 - .listRegistrationKey( - this.client.getEndpoint(), - resourceGroupName, - deviceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRegistrationKeyWithResponseAsync( - String resourceGroupName, String deviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRegistrationKey( - this.client.getEndpoint(), - resourceGroupName, - deviceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listRegistrationKeyAsync(String resourceGroupName, String deviceName) { - return listRegistrationKeyWithResponseAsync(resourceGroupName, deviceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRegistrationKeyWithResponse( - String resourceGroupName, String deviceName, Context context) { - return listRegistrationKeyWithResponseAsync(resourceGroupName, deviceName, context).block(); - } - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceRegistrationKeyInner listRegistrationKey(String resourceGroupName, String deviceName) { - return listRegistrationKeyWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); - } - /** * Get the next page of items. * @@ -1439,11 +1272,11 @@ public DeviceRegistrationKeyInner listRegistrationKey(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1457,7 +1290,7 @@ private Mono> listBySubscriptionNextSinglePageAsync(S return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1478,11 +1311,11 @@ private Mono> listBySubscriptionNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1515,11 +1348,11 @@ private Mono> listBySubscriptionNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1533,7 +1366,7 @@ private Mono> listByResourceGroupNextSinglePageAsync( return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1554,11 +1387,11 @@ private Mono> listByResourceGroupNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call along with {@link PagedResponse} on successful completion of {@link + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesImpl.java new file mode 100644 index 000000000000..fafe7ce95f79 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SitesImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.SitesClient; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.hybridnetwork.models.Site; +import com.azure.resourcemanager.hybridnetwork.models.Sites; + +public final class SitesImpl implements Sites { + private static final ClientLogger LOGGER = new ClientLogger(SitesImpl.class); + + private final SitesClient innerClient; + + private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; + + public SitesImpl( + SitesClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String siteName) { + this.serviceClient().delete(resourceGroupName, siteName); + } + + public void delete(String resourceGroupName, String siteName, Context context) { + this.serviceClient().delete(resourceGroupName, siteName, context); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String siteName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, siteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Site getByResourceGroup(String resourceGroupName, String siteName) { + SiteInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, siteName); + if (inner != null) { + return new SiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public Site getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, siteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, siteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + this.delete(resourceGroupName, siteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + this.delete(resourceGroupName, siteName, context); + } + + private SitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { + return this.serviceManager; + } + + public SiteImpl define(String name) { + return new SiteImpl(name, this.manager()); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.java deleted file mode 100644 index 1fa058763ad5..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/SkuOverviewImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; - -public final class SkuOverviewImpl implements SkuOverview { - private SkuOverviewInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - SkuOverviewImpl( - SkuOverviewInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public SkuType skuType() { - return this.innerModel().skuType(); - } - - public SkuOverviewInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java index 8068264e47d9..d91ed15cef33 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/Utils.java @@ -20,6 +20,9 @@ import reactor.core.publisher.Flux; final class Utils { + private Utils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -133,30 +136,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +198,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java deleted file mode 100644 index 13edfdfcbce0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.management.SubResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.Vendor; -import java.util.Collections; -import java.util.List; - -public final class VendorImpl implements Vendor, Vendor.Definition, Vendor.Update { - private VendorInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public List skus() { - List inner = this.innerModel().skus(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public VendorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - private String vendorName; - - public Vendor create() { - this.innerObject = - serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), Context.NONE); - return this; - } - - public Vendor create(Context context) { - this.innerObject = - serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), context); - return this; - } - - VendorImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = new VendorInner(); - this.serviceManager = serviceManager; - this.vendorName = name; - } - - public VendorImpl update() { - return this; - } - - public Vendor apply() { - this.innerObject = - serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), Context.NONE); - return this; - } - - public Vendor apply(Context context) { - this.innerObject = - serviceManager.serviceClient().getVendors().createOrUpdate(vendorName, this.innerModel(), context); - return this; - } - - VendorImpl(VendorInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); - } - - public Vendor refresh() { - this.innerObject = - serviceManager.serviceClient().getVendors().getWithResponse(vendorName, Context.NONE).getValue(); - return this; - } - - public Vendor refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getVendors().getWithResponse(vendorName, context).getValue(); - return this; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.java deleted file mode 100644 index 6193c1e7e374..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Collections; -import java.util.List; - -public final class VendorNetworkFunctionImpl - implements VendorNetworkFunction, VendorNetworkFunction.Definition, VendorNetworkFunction.Update { - private VendorNetworkFunctionInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public VendorProvisioningState vendorProvisioningState() { - return this.innerModel().vendorProvisioningState(); - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public SkuType skuType() { - return this.innerModel().skuType(); - } - - public List networkFunctionVendorConfigurations() { - List inner = this.innerModel().networkFunctionVendorConfigurations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public VendorNetworkFunctionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - private String locationName; - - private String vendorName; - - private String serviceKey; - - public VendorNetworkFunctionImpl withExistingVendor(String locationName, String vendorName) { - this.locationName = locationName; - this.vendorName = vendorName; - return this; - } - - public VendorNetworkFunction create() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), Context.NONE); - return this; - } - - public VendorNetworkFunction create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), context); - return this; - } - - VendorNetworkFunctionImpl( - String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = new VendorNetworkFunctionInner(); - this.serviceManager = serviceManager; - this.serviceKey = name; - } - - public VendorNetworkFunctionImpl update() { - return this; - } - - public VendorNetworkFunction apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), Context.NONE); - return this; - } - - public VendorNetworkFunction apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .createOrUpdate(locationName, vendorName, serviceKey, this.innerModel(), context); - return this; - } - - VendorNetworkFunctionImpl( - VendorNetworkFunctionInner innerObject, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.locationName = Utils.getValueFromIdByName(innerObject.id(), "locations"); - this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); - this.serviceKey = Utils.getValueFromIdByName(innerObject.id(), "networkFunctions"); - } - - public VendorNetworkFunction refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .getWithResponse(locationName, vendorName, serviceKey, Context.NONE) - .getValue(); - return this; - } - - public VendorNetworkFunction refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorNetworkFunctions() - .getWithResponse(locationName, vendorName, serviceKey, context) - .getValue(); - return this; - } - - public VendorNetworkFunctionImpl withVendorProvisioningState(VendorProvisioningState vendorProvisioningState) { - this.innerModel().withVendorProvisioningState(vendorProvisioningState); - return this; - } - - public VendorNetworkFunctionImpl withNetworkFunctionVendorConfigurations( - List networkFunctionVendorConfigurations) { - this.innerModel().withNetworkFunctionVendorConfigurations(networkFunctionVendorConfigurations); - return this; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java deleted file mode 100644 index 9e68038c459a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsClientImpl.java +++ /dev/null @@ -1,891 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorNetworkFunctionsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctionListResult; -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 VendorNetworkFunctionsClient. */ -public final class VendorNetworkFunctionsClientImpl implements VendorNetworkFunctionsClient { - /** The proxy service used to perform REST calls. */ - private final VendorNetworkFunctionsService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of VendorNetworkFunctionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VendorNetworkFunctionsClientImpl(HybridNetworkManagementClientImpl client) { - this.service = - RestProxy - .create(VendorNetworkFunctionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientVendorNetworkFunctions to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface VendorNetworkFunctionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions/{serviceKey}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @PathParam("serviceKey") String serviceKey, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VendorNetworkFunctionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/locations/{locationName}/vendors" - + "/{vendorName}/networkFunctions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("locationName") String locationName, - @PathParam("vendorName") String vendorName, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @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); - } - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String vendorName, String serviceKey) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required 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 - .get( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String vendorName, String serviceKey, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String vendorName, String serviceKey) { - return getWithResponseAsync(locationName, vendorName, serviceKey) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String locationName, String vendorName, String serviceKey, Context context) { - return getWithResponseAsync(locationName, vendorName, serviceKey, context).block(); - } - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorNetworkFunctionInner get(String locationName, String vendorName, String serviceKey) { - return getWithResponse(locationName, vendorName, serviceKey, Context.NONE).getValue(); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (serviceKey == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceKey is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - locationName, - vendorName, - serviceKey, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorNetworkFunctionInner> beginCreateOrUpdateAsync( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(locationName, vendorName, serviceKey, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VendorNetworkFunctionInner.class, - VendorNetworkFunctionInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorNetworkFunctionInner> beginCreateOrUpdateAsync( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(locationName, vendorName, serviceKey, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VendorNetworkFunctionInner.class, - VendorNetworkFunctionInner.class, - context); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { - return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters).getSyncPoller(); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorNetworkFunctionInner> beginCreateOrUpdate( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { - return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorNetworkFunctionInner createOrUpdate( - String locationName, String vendorName, String serviceKey, VendorNetworkFunctionInner parameters) { - return createOrUpdateAsync(locationName, vendorName, serviceKey, parameters).block(); - } - - /** - * Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This is expected - * service behavior. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param parameters Parameters supplied to the create or update vendor network function operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor network function sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorNetworkFunctionInner createOrUpdate( - String locationName, - String vendorName, - String serviceKey, - VendorNetworkFunctionInner parameters, - Context context) { - return createOrUpdateAsync(locationName, vendorName, serviceKey, parameters, context).block(); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String vendorName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), - locationName, - vendorName, - filter, - 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())); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String vendorName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - locationName, - vendorName, - filter, - 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)); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String vendorName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, vendorName, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String vendorName) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, vendorName, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String locationName, String vendorName, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, vendorName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String vendorName) { - final String filter = null; - return new PagedIterable<>(listAsync(locationName, vendorName, filter)); - } - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String locationName, String vendorName, String filter, Context context) { - return new PagedIterable<>(listAsync(locationName, vendorName, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java deleted file mode 100644 index 2146a757f6df..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorNetworkFunctionsImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorNetworkFunctionsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctions; - -public final class VendorNetworkFunctionsImpl implements VendorNetworkFunctions { - private static final ClientLogger LOGGER = new ClientLogger(VendorNetworkFunctionsImpl.class); - - private final VendorNetworkFunctionsClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public VendorNetworkFunctionsImpl( - VendorNetworkFunctionsClient innerClient, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String locationName, String vendorName, String serviceKey, Context context) { - Response inner = - this.serviceClient().getWithResponse(locationName, vendorName, serviceKey, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VendorNetworkFunctionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public VendorNetworkFunction get(String locationName, String vendorName, String serviceKey) { - VendorNetworkFunctionInner inner = this.serviceClient().get(locationName, vendorName, serviceKey); - if (inner != null) { - return new VendorNetworkFunctionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String locationName, String vendorName) { - PagedIterable inner = this.serviceClient().list(locationName, vendorName); - return Utils.mapPage(inner, inner1 -> new VendorNetworkFunctionImpl(inner1, this.manager())); - } - - public PagedIterable list( - String locationName, String vendorName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().list(locationName, vendorName, filter, context); - return Utils.mapPage(inner, inner1 -> new VendorNetworkFunctionImpl(inner1, this.manager())); - } - - public VendorNetworkFunction getById(String id) { - String locationName = Utils.getValueFromIdByName(id, "locations"); - if (locationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String serviceKey = Utils.getValueFromIdByName(id, "networkFunctions"); - if (serviceKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); - } - return this.getWithResponse(locationName, vendorName, serviceKey, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String locationName = Utils.getValueFromIdByName(id, "locations"); - if (locationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String serviceKey = Utils.getValueFromIdByName(id, "networkFunctions"); - if (serviceKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'networkFunctions'.", id))); - } - return this.getWithResponse(locationName, vendorName, serviceKey, context); - } - - private VendorNetworkFunctionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - public VendorNetworkFunctionImpl define(String name) { - return new VendorNetworkFunctionImpl(name, this.manager()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java deleted file mode 100644 index 4fbe813d45da..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.ProvisioningState; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorSku; - -public final class VendorSkuImpl implements VendorSku, VendorSku.Definition, VendorSku.Update { - private VendorSkuInner innerObject; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SkuType skuType() { - return this.innerModel().skuType(); - } - - public SkuDeploymentMode deploymentMode() { - return this.innerModel().deploymentMode(); - } - - public NetworkFunctionType networkFunctionType() { - return this.innerModel().networkFunctionType(); - } - - public Boolean preview() { - return this.innerModel().preview(); - } - - public Object managedApplicationParameters() { - return this.innerModel().managedApplicationParameters(); - } - - public Object managedApplicationTemplate() { - return this.innerModel().managedApplicationTemplate(); - } - - public NetworkFunctionTemplate networkFunctionTemplate() { - return this.innerModel().networkFunctionTemplate(); - } - - public VendorSkuInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - private String vendorName; - - private String skuName; - - public VendorSkuImpl withExistingVendor(String vendorName) { - this.vendorName = vendorName; - return this; - } - - public VendorSku create() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkus() - .createOrUpdate(vendorName, skuName, this.innerModel(), Context.NONE); - return this; - } - - public VendorSku create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkus() - .createOrUpdate(vendorName, skuName, this.innerModel(), context); - return this; - } - - VendorSkuImpl(String name, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = new VendorSkuInner(); - this.serviceManager = serviceManager; - this.skuName = name; - } - - public VendorSkuImpl update() { - return this; - } - - public VendorSku apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkus() - .createOrUpdate(vendorName, skuName, this.innerModel(), Context.NONE); - return this; - } - - public VendorSku apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkus() - .createOrUpdate(vendorName, skuName, this.innerModel(), context); - return this; - } - - VendorSkuImpl( - VendorSkuInner innerObject, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vendorName = Utils.getValueFromIdByName(innerObject.id(), "vendors"); - this.skuName = Utils.getValueFromIdByName(innerObject.id(), "vendorSkus"); - } - - public VendorSku refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVendorSkus() - .getWithResponse(vendorName, skuName, Context.NONE) - .getValue(); - return this; - } - - public VendorSku refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getVendorSkus().getWithResponse(vendorName, skuName, context).getValue(); - return this; - } - - public VendorSkuImpl withSkuType(SkuType skuType) { - this.innerModel().withSkuType(skuType); - return this; - } - - public VendorSkuImpl withDeploymentMode(SkuDeploymentMode deploymentMode) { - this.innerModel().withDeploymentMode(deploymentMode); - return this; - } - - public VendorSkuImpl withNetworkFunctionType(NetworkFunctionType networkFunctionType) { - this.innerModel().withNetworkFunctionType(networkFunctionType); - return this; - } - - public VendorSkuImpl withPreview(Boolean preview) { - this.innerModel().withPreview(preview); - return this; - } - - public VendorSkuImpl withManagedApplicationParameters(Object managedApplicationParameters) { - this.innerModel().withManagedApplicationParameters(managedApplicationParameters); - return this; - } - - public VendorSkuImpl withManagedApplicationTemplate(Object managedApplicationTemplate) { - this.innerModel().withManagedApplicationTemplate(managedApplicationTemplate); - return this; - } - - public VendorSkuImpl withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate) { - this.innerModel().withNetworkFunctionTemplate(networkFunctionTemplate); - return this; - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java deleted file mode 100644 index a4ad6c17435f..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsClientImpl.java +++ /dev/null @@ -1,1111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkuPreviewsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscriptionsList; -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 VendorSkuPreviewsClient. */ -public final class VendorSkuPreviewsClientImpl implements VendorSkuPreviewsClient { - /** The proxy service used to perform REST calls. */ - private final VendorSkuPreviewsService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of VendorSkuPreviewsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VendorSkuPreviewsClientImpl(HybridNetworkManagementClientImpl client) { - this.service = - RestProxy.create(VendorSkuPreviewsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientVendorSkuPreviews to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface VendorSkuPreviewsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}/previewSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}/previewSubscriptions/{previewSubscription}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @PathParam("previewSubscription") String previewSubscription, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PreviewSubscriptionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}/previewSubscriptions/{previewSubscription}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @PathParam("previewSubscription") String previewSubscription, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}/previewSubscriptions/{previewSubscription}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @PathParam("previewSubscription") String previewSubscription, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vendorName, String skuName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required 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(), - vendorName, - skuName, - 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())); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String vendorName, String skuName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - vendorName, - skuName, - 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)); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vendorName, String skuName) { - return new PagedFlux<>( - () -> listSinglePageAsync(vendorName, skuName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vendorName, String skuName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(vendorName, skuName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vendorName, String skuName) { - return new PagedIterable<>(listAsync(vendorName, skuName)); - } - - /** - * Lists all the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vendorName, String skuName, Context context) { - return new PagedIterable<>(listAsync(vendorName, skuName, context)); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PreviewSubscriptionInner> beginCreateOrUpdateAsync( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(vendorName, skuName, previewSubscription, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PreviewSubscriptionInner.class, - PreviewSubscriptionInner.class, - this.client.getContext()); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PreviewSubscriptionInner> beginCreateOrUpdateAsync( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(vendorName, skuName, previewSubscription, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PreviewSubscriptionInner.class, - PreviewSubscriptionInner.class, - context); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { - return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters).getSyncPoller(); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PreviewSubscriptionInner> beginCreateOrUpdate( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { - return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PreviewSubscriptionInner createOrUpdate( - String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters) { - return createOrUpdateAsync(vendorName, skuName, previewSubscription, parameters).block(); - } - - /** - * Creates or updates preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param parameters Parameters supplied to the create or update vendor preview subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return customer subscription which can use a sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PreviewSubscriptionInner createOrUpdate( - String vendorName, - String skuName, - String previewSubscription, - PreviewSubscriptionInner parameters, - Context context) { - return createOrUpdateAsync(vendorName, skuName, previewSubscription, parameters, context).block(); - } - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String vendorName, String skuName, String previewSubscription) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required 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 - .get( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 preview information of a vendor sku along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String vendorName, String skuName, String previewSubscription, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vendorName, String skuName, String previewSubscription) { - return getWithResponseAsync(vendorName, skuName, previewSubscription) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 preview information of a vendor sku along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String vendorName, String skuName, String previewSubscription, Context context) { - return getWithResponseAsync(vendorName, skuName, previewSubscription, context).block(); - } - - /** - * Gets the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PreviewSubscriptionInner get(String vendorName, String skuName, String previewSubscription) { - return getWithResponse(vendorName, skuName, previewSubscription, Context.NONE).getValue(); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName, String previewSubscription) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required 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 - .delete( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String vendorName, String skuName, String previewSubscription, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (previewSubscription == null) { - return Mono - .error(new IllegalArgumentException("Parameter previewSubscription is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - vendorName, - skuName, - previewSubscription, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName, String previewSubscription) { - Mono>> mono = deleteWithResponseAsync(vendorName, skuName, previewSubscription); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String vendorName, String skuName, String previewSubscription, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(vendorName, skuName, previewSubscription, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 vendorName, String skuName, String previewSubscription) { - return beginDeleteAsync(vendorName, skuName, previewSubscription).getSyncPoller(); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String vendorName, String skuName, String previewSubscription, Context context) { - return beginDeleteAsync(vendorName, skuName, previewSubscription, context).getSyncPoller(); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vendorName, String skuName, String previewSubscription) { - return beginDeleteAsync(vendorName, skuName, previewSubscription) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vendorName, String skuName, String previewSubscription, Context context) { - return beginDeleteAsync(vendorName, skuName, previewSubscription, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vendorName, String skuName, String previewSubscription) { - deleteAsync(vendorName, skuName, previewSubscription).block(); - } - - /** - * Deletes the preview information of a vendor sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vendorName, String skuName, String previewSubscription, Context context) { - deleteAsync(vendorName, skuName, previewSubscription, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of customer subscriptions which can use a sku along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java deleted file mode 100644 index 185a531cb6aa..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkuPreviewsImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorSkuPreviewsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkuPreviews; - -public final class VendorSkuPreviewsImpl implements VendorSkuPreviews { - private static final ClientLogger LOGGER = new ClientLogger(VendorSkuPreviewsImpl.class); - - private final VendorSkuPreviewsClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public VendorSkuPreviewsImpl( - VendorSkuPreviewsClient innerClient, - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vendorName, String skuName) { - PagedIterable inner = this.serviceClient().list(vendorName, skuName); - return Utils.mapPage(inner, inner1 -> new PreviewSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable list(String vendorName, String skuName, Context context) { - PagedIterable inner = this.serviceClient().list(vendorName, skuName, context); - return Utils.mapPage(inner, inner1 -> new PreviewSubscriptionImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String vendorName, String skuName, String previewSubscription, Context context) { - Response inner = - this.serviceClient().getWithResponse(vendorName, skuName, previewSubscription, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PreviewSubscriptionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PreviewSubscription get(String vendorName, String skuName, String previewSubscription) { - PreviewSubscriptionInner inner = this.serviceClient().get(vendorName, skuName, previewSubscription); - if (inner != null) { - return new PreviewSubscriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String vendorName, String skuName, String previewSubscription) { - this.serviceClient().delete(vendorName, skuName, previewSubscription); - } - - public void delete(String vendorName, String skuName, String previewSubscription, Context context) { - this.serviceClient().delete(vendorName, skuName, previewSubscription, context); - } - - public PreviewSubscription getById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); - if (previewSubscription == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", - id))); - } - return this.getWithResponse(vendorName, skuName, previewSubscription, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); - if (previewSubscription == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", - id))); - } - return this.getWithResponse(vendorName, skuName, previewSubscription, context); - } - - public void deleteById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); - if (previewSubscription == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", - id))); - } - this.delete(vendorName, skuName, previewSubscription, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - String previewSubscription = Utils.getValueFromIdByName(id, "previewSubscriptions"); - if (previewSubscription == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'previewSubscriptions'.", - id))); - } - this.delete(vendorName, skuName, previewSubscription, context); - } - - private VendorSkuPreviewsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - public PreviewSubscriptionImpl define(String name) { - return new PreviewSubscriptionImpl(name, this.manager()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java deleted file mode 100644 index 4ace8d5aba02..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusClientImpl.java +++ /dev/null @@ -1,988 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkuListResult; -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 VendorSkusClient. */ -public final class VendorSkusClientImpl implements VendorSkusClient { - /** The proxy service used to perform REST calls. */ - private final VendorSkusService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of VendorSkusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VendorSkusClientImpl(HybridNetworkManagementClientImpl client) { - this.service = - RestProxy.create(VendorSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientVendorSkus to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface VendorSkusService { - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @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.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus" - + "/{skuName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @PathParam("skuName") String skuName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VendorSkuInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @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); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required 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 - .delete( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName) { - Mono>> mono = deleteWithResponseAsync(vendorName, skuName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, String skuName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(vendorName, skuName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 vendorName, String skuName) { - return beginDeleteAsync(vendorName, skuName).getSyncPoller(); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 vendorName, String skuName, Context context) { - return beginDeleteAsync(vendorName, skuName, context).getSyncPoller(); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vendorName, String skuName) { - return beginDeleteAsync(vendorName, skuName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vendorName, String skuName, Context context) { - return beginDeleteAsync(vendorName, skuName, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vendorName, String skuName) { - deleteAsync(vendorName, skuName).block(); - } - - /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vendorName, String skuName, Context context) { - deleteAsync(vendorName, skuName, context).block(); - } - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vendorName, String skuName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required 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 - .get( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vendorName, String skuName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vendorName, String skuName) { - return getWithResponseAsync(vendorName, skuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vendorName, String skuName, Context context) { - return getWithResponseAsync(vendorName, skuName, context).block(); - } - - /** - * Gets information about the specified sku. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorSkuInner get(String vendorName, String skuName) { - return getWithResponse(vendorName, skuName, Context.NONE).getValue(); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, String skuName, VendorSkuInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, String skuName, VendorSkuInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (skuName == null) { - return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - skuName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorSkuInner> beginCreateOrUpdateAsync( - String vendorName, String skuName, VendorSkuInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(vendorName, skuName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VendorSkuInner.class, - VendorSkuInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorSkuInner> beginCreateOrUpdateAsync( - String vendorName, String skuName, VendorSkuInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(vendorName, skuName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VendorSkuInner.class, VendorSkuInner.class, context); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorSkuInner> beginCreateOrUpdate( - String vendorName, String skuName, VendorSkuInner parameters) { - return beginCreateOrUpdateAsync(vendorName, skuName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of sku sub resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorSkuInner> beginCreateOrUpdate( - String vendorName, String skuName, VendorSkuInner parameters, Context context) { - return beginCreateOrUpdateAsync(vendorName, skuName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vendorName, String skuName, VendorSkuInner parameters) { - return beginCreateOrUpdateAsync(vendorName, skuName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String vendorName, String skuName, VendorSkuInner parameters, Context context) { - return beginCreateOrUpdateAsync(vendorName, skuName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorSkuInner createOrUpdate(String vendorName, String skuName, VendorSkuInner parameters) { - return createOrUpdateAsync(vendorName, skuName, parameters).block(); - } - - /** - * Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service behavior. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @param parameters Parameters supplied to the create or update sku operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sku sub resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorSkuInner createOrUpdate( - String vendorName, String skuName, VendorSkuInner parameters, Context context) { - return createOrUpdateAsync(vendorName, skuName, parameters, context).block(); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vendorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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(), - vendorName, - 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())); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vendorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - vendorName, - 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)); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vendorName) { - return new PagedFlux<>(() -> listSinglePageAsync(vendorName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vendorName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(vendorName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vendorName) { - return new PagedIterable<>(listAsync(vendorName)); - } - - /** - * Lists all the skus of a vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vendorName, Context context) { - return new PagedIterable<>(listAsync(vendorName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.java deleted file mode 100644 index 7dcfc7b19c2a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorSkusImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorSkusClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorSku; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkus; - -public final class VendorSkusImpl implements VendorSkus { - private static final ClientLogger LOGGER = new ClientLogger(VendorSkusImpl.class); - - private final VendorSkusClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public VendorSkusImpl( - VendorSkusClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void deleteByResourceGroup(String vendorName, String skuName) { - this.serviceClient().delete(vendorName, skuName); - } - - public void delete(String vendorName, String skuName, Context context) { - this.serviceClient().delete(vendorName, skuName, context); - } - - public Response getWithResponse(String vendorName, String skuName, Context context) { - Response inner = this.serviceClient().getWithResponse(vendorName, skuName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VendorSkuImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public VendorSku get(String vendorName, String skuName) { - VendorSkuInner inner = this.serviceClient().get(vendorName, skuName); - if (inner != null) { - return new VendorSkuImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String vendorName) { - PagedIterable inner = this.serviceClient().list(vendorName); - return Utils.mapPage(inner, inner1 -> new VendorSkuImpl(inner1, this.manager())); - } - - public PagedIterable list(String vendorName, Context context) { - PagedIterable inner = this.serviceClient().list(vendorName, context); - return Utils.mapPage(inner, inner1 -> new VendorSkuImpl(inner1, this.manager())); - } - - public VendorSku getById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - return this.getWithResponse(vendorName, skuName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - return this.getWithResponse(vendorName, skuName, context); - } - - public void deleteById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - this.delete(vendorName, skuName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - String skuName = Utils.getValueFromIdByName(id, "vendorSkus"); - if (skuName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendorSkus'.", id))); - } - this.delete(vendorName, skuName, context); - } - - private VendorSkusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - public VendorSkuImpl define(String name) { - return new VendorSkuImpl(name, this.manager()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java deleted file mode 100644 index 2e59453bd772..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsClientImpl.java +++ /dev/null @@ -1,934 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hybridnetwork.fluent.VendorsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorListResult; -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 VendorsClient. */ -public final class VendorsClientImpl implements VendorsClient { - /** The proxy service used to perform REST calls. */ - private final VendorsService service; - - /** The service client containing this operation class. */ - private final HybridNetworkManagementClientImpl client; - - /** - * Initializes an instance of VendorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VendorsClientImpl(HybridNetworkManagementClientImpl client) { - this.service = RestProxy.create(VendorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HybridNetworkManagementClientVendors to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HybridNetworkManagem") - private interface VendorsService { - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @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.HybridNetwork/vendors/{vendorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("vendorName") String vendorName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VendorInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors") - @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("{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); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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 - .delete( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName) { - Mono>> mono = deleteWithResponseAsync(vendorName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(vendorName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 vendorName) { - return beginDeleteAsync(vendorName).getSyncPoller(); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 vendorName, Context context) { - return beginDeleteAsync(vendorName, context).getSyncPoller(); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vendorName) { - return beginDeleteAsync(vendorName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vendorName, Context context) { - return beginDeleteAsync(vendorName, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vendorName) { - deleteAsync(vendorName).block(); - } - - /** - * Deletes the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vendorName, Context context) { - deleteAsync(vendorName, context).block(); - } - - /** - * Gets information about the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vendorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required 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 - .get( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vendorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets information about the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vendorName) { - return getWithResponseAsync(vendorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about the specified vendor. - * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vendorName, Context context) { - return getWithResponseAsync(vendorName, context).block(); - } - - /** - * Gets information about the specified vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorInner get(String vendorName) { - return getWithResponse(vendorName, Context.NONE).getValue(); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, VendorInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String vendorName, VendorInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (vendorName == null) { - return Mono.error(new IllegalArgumentException("Parameter vendorName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - vendorName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendor resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorInner> beginCreateOrUpdateAsync( - String vendorName, VendorInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(vendorName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VendorInner.class, VendorInner.class, this.client.getContext()); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 vendor resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorInner> beginCreateOrUpdateAsync(String vendorName) { - final VendorInner parameters = null; - Mono>> mono = createOrUpdateWithResponseAsync(vendorName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VendorInner.class, VendorInner.class, this.client.getContext()); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of vendor resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VendorInner> beginCreateOrUpdateAsync( - String vendorName, VendorInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(vendorName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VendorInner.class, VendorInner.class, context); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorInner> beginCreateOrUpdate(String vendorName) { - final VendorInner parameters = null; - return beginCreateOrUpdateAsync(vendorName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of vendor resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VendorInner> beginCreateOrUpdate( - String vendorName, VendorInner parameters, Context context) { - return beginCreateOrUpdateAsync(vendorName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vendorName, VendorInner parameters) { - return beginCreateOrUpdateAsync(vendorName, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vendorName) { - final VendorInner parameters = null; - return beginCreateOrUpdateAsync(vendorName, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vendorName, VendorInner parameters, Context context) { - return beginCreateOrUpdateAsync(vendorName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorInner createOrUpdate(String vendorName) { - final VendorInner parameters = null; - return createOrUpdateAsync(vendorName, parameters).block(); - } - - /** - * Creates or updates a vendor. - * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vendor resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VendorInner createOrUpdate(String vendorName, VendorInner parameters, Context context) { - return createOrUpdateAsync(vendorName, parameters, context).block(); - } - - /** - * Lists all the vendors in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call 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())); - } - - /** - * Lists all the vendors in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the vendors in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the vendors in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the vendors in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the vendors in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java deleted file mode 100644 index f4a4163bed49..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/implementation/VendorsImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.VendorsClient; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import com.azure.resourcemanager.hybridnetwork.models.Vendor; -import com.azure.resourcemanager.hybridnetwork.models.Vendors; - -public final class VendorsImpl implements Vendors { - private static final ClientLogger LOGGER = new ClientLogger(VendorsImpl.class); - - private final VendorsClient innerClient; - - private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager; - - public VendorsImpl( - VendorsClient innerClient, com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String vendorName) { - this.serviceClient().delete(vendorName); - } - - public void delete(String vendorName, Context context) { - this.serviceClient().delete(vendorName, context); - } - - public Response getWithResponse(String vendorName, Context context) { - Response inner = this.serviceClient().getWithResponse(vendorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VendorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Vendor get(String vendorName) { - VendorInner inner = this.serviceClient().get(vendorName); - if (inner != null) { - return new VendorImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VendorImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VendorImpl(inner1, this.manager())); - } - - public Vendor getById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - return this.getWithResponse(vendorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - return this.getWithResponse(vendorName, context); - } - - public void deleteById(String id) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - this.delete(vendorName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String vendorName = Utils.getValueFromIdByName(id, "vendors"); - if (vendorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vendors'.", id))); - } - this.delete(vendorName, context); - } - - private VendorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() { - return this.serviceManager; - } - - public VendorImpl define(String name) { - return new VendorImpl(name, this.manager()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ActionType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ActionType.java new file mode 100644 index 000000000000..bc27f97c9961 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ApplicationEnablement.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ApplicationEnablement.java new file mode 100644 index 000000000000..d650300d1b99 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ApplicationEnablement.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The application enablement. */ +public final class ApplicationEnablement extends ExpandableStringEnum { + /** Static value Unknown for ApplicationEnablement. */ + public static final ApplicationEnablement UNKNOWN = fromString("Unknown"); + + /** Static value Enabled for ApplicationEnablement. */ + public static final ApplicationEnablement ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationEnablement. */ + public static final ApplicationEnablement DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ApplicationEnablement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationEnablement() { + } + + /** + * Creates or finds a ApplicationEnablement from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationEnablement. + */ + @JsonCreator + public static ApplicationEnablement fromString(String name) { + return fromString(name, ApplicationEnablement.class); + } + + /** + * Gets known ApplicationEnablement values. + * + * @return known ApplicationEnablement values. + */ + public static Collection values() { + return values(ApplicationEnablement.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplate.java new file mode 100644 index 000000000000..4baf485a3594 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplate.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The arm template RE. */ +@Fluent +public final class ArmResourceDefinitionResourceElementTemplate { + /* + * The template type. + */ + @JsonProperty(value = "templateType") + private TemplateType templateType; + + /* + * Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. + */ + @JsonProperty(value = "parameterValues") + private String parameterValues; + + /* + * Artifact profile properties. + */ + @JsonProperty(value = "artifactProfile") + private NsdArtifactProfile artifactProfile; + + /** Creates an instance of ArmResourceDefinitionResourceElementTemplate class. */ + public ArmResourceDefinitionResourceElementTemplate() { + } + + /** + * Get the templateType property: The template type. + * + * @return the templateType value. + */ + public TemplateType templateType() { + return this.templateType; + } + + /** + * Set the templateType property: The template type. + * + * @param templateType the templateType value to set. + * @return the ArmResourceDefinitionResourceElementTemplate object itself. + */ + public ArmResourceDefinitionResourceElementTemplate withTemplateType(TemplateType templateType) { + this.templateType = templateType; + return this; + } + + /** + * Get the parameterValues property: Name and value pairs that define the parameter values. It can be a well formed + * escaped JSON string. + * + * @return the parameterValues value. + */ + public String parameterValues() { + return this.parameterValues; + } + + /** + * Set the parameterValues property: Name and value pairs that define the parameter values. It can be a well formed + * escaped JSON string. + * + * @param parameterValues the parameterValues value to set. + * @return the ArmResourceDefinitionResourceElementTemplate object itself. + */ + public ArmResourceDefinitionResourceElementTemplate withParameterValues(String parameterValues) { + this.parameterValues = parameterValues; + return this; + } + + /** + * Get the artifactProfile property: Artifact profile properties. + * + * @return the artifactProfile value. + */ + public NsdArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Artifact profile properties. + * + * @param artifactProfile the artifactProfile value to set. + * @return the ArmResourceDefinitionResourceElementTemplate object itself. + */ + public ArmResourceDefinitionResourceElementTemplate withArtifactProfile(NsdArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifactProfile() != null) { + artifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplateDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplateDetails.java new file mode 100644 index 000000000000..28bc5a22e0b5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmResourceDefinitionResourceElementTemplateDetails.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The arm resource definition resource element template details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ArmResourceDefinition") +@Fluent +public final class ArmResourceDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + /* + * The resource element template type. + */ + @JsonProperty(value = "configuration") + private ArmResourceDefinitionResourceElementTemplate configuration; + + /** Creates an instance of ArmResourceDefinitionResourceElementTemplateDetails class. */ + public ArmResourceDefinitionResourceElementTemplateDetails() { + } + + /** + * Get the configuration property: The resource element template type. + * + * @return the configuration value. + */ + public ArmResourceDefinitionResourceElementTemplate configuration() { + return this.configuration; + } + + /** + * Set the configuration property: The resource element template type. + * + * @param configuration the configuration value to set. + * @return the ArmResourceDefinitionResourceElementTemplateDetails object itself. + */ + public ArmResourceDefinitionResourceElementTemplateDetails withConfiguration( + ArmResourceDefinitionResourceElementTemplate configuration) { + this.configuration = configuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public ArmResourceDefinitionResourceElementTemplateDetails withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ArmResourceDefinitionResourceElementTemplateDetails withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateArtifactProfile.java new file mode 100644 index 000000000000..ef657ddf2252 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Template artifact profile. */ +@Fluent +public final class ArmTemplateArtifactProfile { + /* + * Template name. + */ + @JsonProperty(value = "templateName") + private String templateName; + + /* + * Template version. + */ + @JsonProperty(value = "templateVersion") + private String templateVersion; + + /** Creates an instance of ArmTemplateArtifactProfile class. */ + public ArmTemplateArtifactProfile() { + } + + /** + * Get the templateName property: Template name. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: Template name. + * + * @param templateName the templateName value to set. + * @return the ArmTemplateArtifactProfile object itself. + */ + public ArmTemplateArtifactProfile withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Get the templateVersion property: Template version. + * + * @return the templateVersion value. + */ + public String templateVersion() { + return this.templateVersion; + } + + /** + * Set the templateVersion property: Template version. + * + * @param templateVersion the templateVersion value to set. + * @return the ArmTemplateArtifactProfile object itself. + */ + public ArmTemplateArtifactProfile withTemplateVersion(String templateVersion) { + this.templateVersion = templateVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateMappingRuleProfile.java new file mode 100644 index 000000000000..f146a8cc13d4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArmTemplateMappingRuleProfile.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Template mapping rule profile. */ +@Fluent +public final class ArmTemplateMappingRuleProfile { + /* + * List of template parameters. + */ + @JsonProperty(value = "templateParameters") + private String templateParameters; + + /** Creates an instance of ArmTemplateMappingRuleProfile class. */ + public ArmTemplateMappingRuleProfile() { + } + + /** + * Get the templateParameters property: List of template parameters. + * + * @return the templateParameters value. + */ + public String templateParameters() { + return this.templateParameters; + } + + /** + * Set the templateParameters property: List of template parameters. + * + * @param templateParameters the templateParameters value to set. + * @return the ArmTemplateMappingRuleProfile object itself. + */ + public ArmTemplateMappingRuleProfile withTemplateParameters(String templateParameters) { + this.templateParameters = templateParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactAccessCredential.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactAccessCredential.java new file mode 100644 index 000000000000..b607489cf518 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactAccessCredential.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; + +/** An immutable client-side representation of ArtifactAccessCredential. */ +public interface ArtifactAccessCredential { + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner object. + * + * @return the inner object. + */ + ArtifactAccessCredentialInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeState.java new file mode 100644 index 000000000000..914eba73883a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The artifact updating request payload. */ +@Fluent +public final class ArtifactChangeState { + /* + * Artifact update state properties. + */ + @JsonProperty(value = "properties") + private ArtifactChangeStateProperties properties; + + /** Creates an instance of ArtifactChangeState class. */ + public ArtifactChangeState() { + } + + /** + * Get the properties property: Artifact update state properties. + * + * @return the properties value. + */ + public ArtifactChangeStateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Artifact update state properties. + * + * @param properties the properties value to set. + * @return the ArtifactChangeState object itself. + */ + public ArtifactChangeState withProperties(ArtifactChangeStateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeStateProperties.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeStateProperties.java new file mode 100644 index 000000000000..3b1ddfebe21c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactChangeStateProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The artifact update state properties. */ +@Fluent +public final class ArtifactChangeStateProperties { + /* + * The artifact state + */ + @JsonProperty(value = "artifactState") + private ArtifactState artifactState; + + /** Creates an instance of ArtifactChangeStateProperties class. */ + public ArtifactChangeStateProperties() { + } + + /** + * Get the artifactState property: The artifact state. + * + * @return the artifactState value. + */ + public ArtifactState artifactState() { + return this.artifactState; + } + + /** + * Set the artifactState property: The artifact state. + * + * @param artifactState the artifactState value to set. + * @return the ArtifactChangeStateProperties object itself. + */ + public ArtifactChangeStateProperties withArtifactState(ArtifactState artifactState) { + this.artifactState = artifactState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifest.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifest.java new file mode 100644 index 000000000000..7e887e00a2b6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifest.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.ArtifactManifestInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import java.util.Map; + +/** An immutable client-side representation of ArtifactManifest. */ +public interface ArtifactManifest { + /** + * 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: Artifact manifest properties. + * + * @return the properties value. + */ + ArtifactManifestPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.ArtifactManifestInner object. + * + * @return the inner object. + */ + ArtifactManifestInner innerModel(); + + /** The entirety of the ArtifactManifest definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The ArtifactManifest definition stages. */ + interface DefinitionStages { + /** The first stage of the ArtifactManifest definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ArtifactManifest 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the ArtifactManifest definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName, artifactStoreName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @return the next definition stage. + */ + WithCreate withExistingArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName); + } + + /** + * The stage of the ArtifactManifest 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArtifactManifest create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArtifactManifest create(Context context); + } + + /** The stage of the ArtifactManifest 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 ArtifactManifest definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Artifact manifest properties.. + * + * @param properties Artifact manifest properties. + * @return the next definition stage. + */ + WithCreate withProperties(ArtifactManifestPropertiesFormat properties); + } + } + + /** + * Begins update for the ArtifactManifest resource. + * + * @return the stage of resource update. + */ + ArtifactManifest.Update update(); + + /** The template for ArtifactManifest update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArtifactManifest apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArtifactManifest apply(Context context); + } + + /** The ArtifactManifest update stages. */ + interface UpdateStages { + /** The stage of the ArtifactManifest 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArtifactManifest refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArtifactManifest refresh(Context context); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response}. + */ + Response listCredentialWithResponse(Context context); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition. + */ + ArtifactAccessCredential listCredential(); + + /** + * Update state for artifact manifest. + * + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + ArtifactManifestUpdateState updateState(ArtifactManifestUpdateStateInner parameters); + + /** + * Update state for artifact manifest. + * + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + ArtifactManifestUpdateState updateState(ArtifactManifestUpdateStateInner parameters, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestListResult.java similarity index 64% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestListResult.java index c5f1dcb62b27..5c4b587f6ceb 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuListResult.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response for list vendor sku API service call. */ +/** A list of artifact manifests. */ @Fluent -public final class VendorSkuListResult { +public final class ArtifactManifestListResult { /* - * A list of vendor skus offered by the vendor. + * A list of artifact manifests. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URI to get the next set of results. @@ -24,26 +24,26 @@ public final class VendorSkuListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of VendorSkuListResult class. */ - public VendorSkuListResult() { + /** Creates an instance of ArtifactManifestListResult class. */ + public ArtifactManifestListResult() { } /** - * Get the value property: A list of vendor skus offered by the vendor. + * Get the value property: A list of artifact manifests. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of vendor skus offered by the vendor. + * Set the value property: A list of artifact manifests. * * @param value the value value to set. - * @return the VendorSkuListResult object itself. + * @return the ArtifactManifestListResult object itself. */ - public VendorSkuListResult withValue(List value) { + public ArtifactManifestListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestPropertiesFormat.java new file mode 100644 index 000000000000..5f51ab706e2c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestPropertiesFormat.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Artifact manifest properties. */ +@Fluent +public final class ArtifactManifestPropertiesFormat { + /* + * The provisioning state of the ArtifactManifest resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The artifact manifest state. + */ + @JsonProperty(value = "artifactManifestState", access = JsonProperty.Access.WRITE_ONLY) + private ArtifactManifestState artifactManifestState; + + /* + * The artifacts list. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /** Creates an instance of ArtifactManifestPropertiesFormat class. */ + public ArtifactManifestPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the ArtifactManifest resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the artifactManifestState property: The artifact manifest state. + * + * @return the artifactManifestState value. + */ + public ArtifactManifestState artifactManifestState() { + return this.artifactManifestState; + } + + /** + * Get the artifacts property: The artifacts list. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The artifacts list. + * + * @param artifacts the artifacts value to set. + * @return the ArtifactManifestPropertiesFormat object itself. + */ + public ArtifactManifestPropertiesFormat withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifacts() != null) { + artifacts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestState.java new file mode 100644 index 000000000000..e41fe068ce21 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact manifest state. */ +public final class ArtifactManifestState extends ExpandableStringEnum { + /** Static value Unknown for ArtifactManifestState. */ + public static final ArtifactManifestState UNKNOWN = fromString("Unknown"); + + /** Static value Uploading for ArtifactManifestState. */ + public static final ArtifactManifestState UPLOADING = fromString("Uploading"); + + /** Static value Uploaded for ArtifactManifestState. */ + public static final ArtifactManifestState UPLOADED = fromString("Uploaded"); + + /** Static value Validating for ArtifactManifestState. */ + public static final ArtifactManifestState VALIDATING = fromString("Validating"); + + /** Static value ValidationFailed for ArtifactManifestState. */ + public static final ArtifactManifestState VALIDATION_FAILED = fromString("ValidationFailed"); + + /** Static value Succeeded for ArtifactManifestState. */ + public static final ArtifactManifestState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of ArtifactManifestState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactManifestState() { + } + + /** + * Creates or finds a ArtifactManifestState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactManifestState. + */ + @JsonCreator + public static ArtifactManifestState fromString(String name) { + return fromString(name, ArtifactManifestState.class); + } + + /** + * Gets known ArtifactManifestState values. + * + * @return known ArtifactManifestState values. + */ + public static Collection values() { + return values(ArtifactManifestState.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestUpdateState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestUpdateState.java new file mode 100644 index 000000000000..94293d77c5da --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifestUpdateState.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; + +/** An immutable client-side representation of ArtifactManifestUpdateState. */ +public interface ArtifactManifestUpdateState { + /** + * Gets the artifactManifestState property: The artifact manifest state. + * + * @return the artifactManifestState value. + */ + ArtifactManifestState artifactManifestState(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner object. + * + * @return the inner object. + */ + ArtifactManifestUpdateStateInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifests.java new file mode 100644 index 000000000000..3d666a7427ec --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactManifests.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; + +/** Resource collection API of ArtifactManifests. */ +public interface ArtifactManifests { + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName); + + /** + * Gets information about the artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the artifact manifest as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArtifactStore( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Deletes the specified artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * Gets information about a artifact manifest resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a artifact manifest resource. + */ + ArtifactManifest get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition along with {@link Response}. + */ + Response listCredentialWithResponse( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + Context context); + + /** + * List credential for publishing artifacts defined in artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest credential definition. + */ + ArtifactAccessCredential listCredential( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactManifestName); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + ArtifactManifestUpdateState updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters); + + /** + * Update state for artifact manifest. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactManifestName The name of the artifact manifest. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the artifact manifest updating request payload. + */ + ArtifactManifestUpdateState updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactManifestName, + ArtifactManifestUpdateStateInner parameters, + Context context); + + /** + * Gets information about a artifact manifest resource. + * + * @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 information about a artifact manifest resource along with {@link Response}. + */ + ArtifactManifest getById(String id); + + /** + * Gets information about a artifact manifest resource. + * + * @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 information about a artifact manifest resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified artifact manifest. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified artifact manifest. + * + * @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 ArtifactManifest resource. + * + * @param name resource name. + * @return the first stage of the new ArtifactManifest definition. + */ + ArtifactManifest.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactProfile.java new file mode 100644 index 000000000000..83ea7265af36 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactProfile.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Artifact profile properties. */ +@Fluent +public class ArtifactProfile { + /* + * The reference to artifact store. + */ + @JsonProperty(value = "artifactStore") + private ReferencedResource artifactStore; + + /** Creates an instance of ArtifactProfile class. */ + public ArtifactProfile() { + } + + /** + * Get the artifactStore property: The reference to artifact store. + * + * @return the artifactStore value. + */ + public ReferencedResource artifactStore() { + return this.artifactStore; + } + + /** + * Set the artifactStore property: The reference to artifact store. + * + * @param artifactStore the artifactStore value to set. + * @return the ArtifactProfile object itself. + */ + public ArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + this.artifactStore = artifactStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifactStore() != null) { + artifactStore().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactReplicationStrategy.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactReplicationStrategy.java new file mode 100644 index 000000000000..09cd16e1a3f7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactReplicationStrategy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The replication strategy. */ +public final class ArtifactReplicationStrategy extends ExpandableStringEnum { + /** Static value Unknown for ArtifactReplicationStrategy. */ + public static final ArtifactReplicationStrategy UNKNOWN = fromString("Unknown"); + + /** Static value SingleReplication for ArtifactReplicationStrategy. */ + public static final ArtifactReplicationStrategy SINGLE_REPLICATION = fromString("SingleReplication"); + + /** + * Creates a new instance of ArtifactReplicationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactReplicationStrategy() { + } + + /** + * Creates or finds a ArtifactReplicationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactReplicationStrategy. + */ + @JsonCreator + public static ArtifactReplicationStrategy fromString(String name) { + return fromString(name, ArtifactReplicationStrategy.class); + } + + /** + * Gets known ArtifactReplicationStrategy values. + * + * @return known ArtifactReplicationStrategy values. + */ + public static Collection values() { + return values(ArtifactReplicationStrategy.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactState.java new file mode 100644 index 000000000000..254f8c125a62 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact state. */ +public final class ArtifactState extends ExpandableStringEnum { + /** Static value Unknown for ArtifactState. */ + public static final ArtifactState UNKNOWN = fromString("Unknown"); + + /** Static value Preview for ArtifactState. */ + public static final ArtifactState PREVIEW = fromString("Preview"); + + /** Static value Active for ArtifactState. */ + public static final ArtifactState ACTIVE = fromString("Active"); + + /** Static value Deprecated for ArtifactState. */ + public static final ArtifactState DEPRECATED = fromString("Deprecated"); + + /** + * Creates a new instance of ArtifactState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactState() { + } + + /** + * Creates or finds a ArtifactState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactState. + */ + @JsonCreator + public static ArtifactState fromString(String name) { + return fromString(name, ArtifactState.class); + } + + /** + * Gets known ArtifactState values. + * + * @return known ArtifactState values. + */ + public static Collection values() { + return values(ArtifactState.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStore.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStore.java new file mode 100644 index 000000000000..1f5bdfec11bc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStore.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner; +import java.util.Map; + +/** An immutable client-side representation of ArtifactStore. */ +public interface ArtifactStore { + /** + * 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: ArtifactStores properties. + * + * @return the properties value. + */ + ArtifactStorePropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.ArtifactStoreInner object. + * + * @return the inner object. + */ + ArtifactStoreInner innerModel(); + + /** The entirety of the ArtifactStore definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The ArtifactStore definition stages. */ + interface DefinitionStages { + /** The first stage of the ArtifactStore definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ArtifactStore 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the ArtifactStore definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @return the next definition stage. + */ + WithCreate withExistingPublisher(String resourceGroupName, String publisherName); + } + + /** + * The stage of the ArtifactStore 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArtifactStore create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArtifactStore create(Context context); + } + + /** The stage of the ArtifactStore 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 ArtifactStore definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ArtifactStores properties.. + * + * @param properties ArtifactStores properties. + * @return the next definition stage. + */ + WithCreate withProperties(ArtifactStorePropertiesFormat properties); + } + } + + /** + * Begins update for the ArtifactStore resource. + * + * @return the stage of resource update. + */ + ArtifactStore.Update update(); + + /** The template for ArtifactStore update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArtifactStore apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArtifactStore apply(Context context); + } + + /** The ArtifactStore update stages. */ + interface UpdateStages { + /** The stage of the ArtifactStore 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArtifactStore refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArtifactStore refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreListResult.java similarity index 63% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreListResult.java index 1885032cd23a..76e6c34283a3 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscriptionsList.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of customer subscriptions which can use a sku. */ +/** A list of artifact stores. */ @Fluent -public final class PreviewSubscriptionsList { +public final class ArtifactStoreListResult { /* - * A list of preview subscriptions. + * A list of artifact stores. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class PreviewSubscriptionsList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of PreviewSubscriptionsList class. */ - public PreviewSubscriptionsList() { + /** Creates an instance of ArtifactStoreListResult class. */ + public ArtifactStoreListResult() { } /** - * Get the value property: A list of preview subscriptions. + * Get the value property: A list of artifact stores. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of preview subscriptions. + * Set the value property: A list of artifact stores. * * @param value the value value to set. - * @return the PreviewSubscriptionsList object itself. + * @return the ArtifactStoreListResult object itself. */ - public PreviewSubscriptionsList withValue(List value) { + public ArtifactStoreListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormat.java new file mode 100644 index 000000000000..2e5eaa88cee5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormat.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Artifact store properties. */ +@Fluent +public final class ArtifactStorePropertiesFormat { + /* + * The provisioning state of the application groups resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The artifact store type. + */ + @JsonProperty(value = "storeType") + private ArtifactStoreType storeType; + + /* + * The replication strategy. + */ + @JsonProperty(value = "replicationStrategy") + private ArtifactReplicationStrategy replicationStrategy; + + /* + * The managedResourceGroupConfiguration property. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ArtifactStorePropertiesFormatManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * The created storage resource id + */ + @JsonProperty(value = "storageResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String storageResourceId; + + /** Creates an instance of ArtifactStorePropertiesFormat class. */ + public ArtifactStorePropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the application groups resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storeType property: The artifact store type. + * + * @return the storeType value. + */ + public ArtifactStoreType storeType() { + return this.storeType; + } + + /** + * Set the storeType property: The artifact store type. + * + * @param storeType the storeType value to set. + * @return the ArtifactStorePropertiesFormat object itself. + */ + public ArtifactStorePropertiesFormat withStoreType(ArtifactStoreType storeType) { + this.storeType = storeType; + return this; + } + + /** + * Get the replicationStrategy property: The replication strategy. + * + * @return the replicationStrategy value. + */ + public ArtifactReplicationStrategy replicationStrategy() { + return this.replicationStrategy; + } + + /** + * Set the replicationStrategy property: The replication strategy. + * + * @param replicationStrategy the replicationStrategy value to set. + * @return the ArtifactStorePropertiesFormat object itself. + */ + public ArtifactStorePropertiesFormat withReplicationStrategy(ArtifactReplicationStrategy replicationStrategy) { + this.replicationStrategy = replicationStrategy; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: The managedResourceGroupConfiguration property. + * + * @return the managedResourceGroupConfiguration value. + */ + public ArtifactStorePropertiesFormatManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: The managedResourceGroupConfiguration property. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the ArtifactStorePropertiesFormat object itself. + */ + public ArtifactStorePropertiesFormat withManagedResourceGroupConfiguration( + ArtifactStorePropertiesFormatManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the storageResourceId property: The created storage resource id. + * + * @return the storageResourceId value. + */ + public String storageResourceId() { + return this.storageResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormatManagedResourceGroupConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormatManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..db05c44dd18a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStorePropertiesFormatManagedResourceGroupConfiguration.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ArtifactStorePropertiesFormatManagedResourceGroupConfiguration model. */ +@Fluent +public final class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration { + /* + * The managed resource group name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The managed resource group location. + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ArtifactStorePropertiesFormatManagedResourceGroupConfiguration class. */ + public ArtifactStorePropertiesFormatManagedResourceGroupConfiguration() { + } + + /** + * Get the name property: The managed resource group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The managed resource group name. + * + * @param name the name value to set. + * @return the ArtifactStorePropertiesFormatManagedResourceGroupConfiguration object itself. + */ + public ArtifactStorePropertiesFormatManagedResourceGroupConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: The managed resource group location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The managed resource group location. + * + * @param location the location value to set. + * @return the ArtifactStorePropertiesFormatManagedResourceGroupConfiguration object itself. + */ + public ArtifactStorePropertiesFormatManagedResourceGroupConfiguration withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreType.java new file mode 100644 index 000000000000..c381e60891e2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStoreType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact store type. */ +public final class ArtifactStoreType extends ExpandableStringEnum { + /** Static value Unknown for ArtifactStoreType. */ + public static final ArtifactStoreType UNKNOWN = fromString("Unknown"); + + /** Static value AzureContainerRegistry for ArtifactStoreType. */ + public static final ArtifactStoreType AZURE_CONTAINER_REGISTRY = fromString("AzureContainerRegistry"); + + /** Static value AzureStorageAccount for ArtifactStoreType. */ + public static final ArtifactStoreType AZURE_STORAGE_ACCOUNT = fromString("AzureStorageAccount"); + + /** + * Creates a new instance of ArtifactStoreType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactStoreType() { + } + + /** + * Creates or finds a ArtifactStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactStoreType. + */ + @JsonCreator + public static ArtifactStoreType fromString(String name) { + return fromString(name, ArtifactStoreType.class); + } + + /** + * Gets known ArtifactStoreType values. + * + * @return known ArtifactStoreType values. + */ + public static Collection values() { + return values(ArtifactStoreType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStores.java similarity index 56% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStores.java index 3a9bd61249ea..4077bd968086 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkuPreviews.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactStores.java @@ -8,111 +8,111 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VendorSkuPreviews. */ -public interface VendorSkuPreviews { +/** Resource collection API of ArtifactStores. */ +public interface ArtifactStores { /** - * Lists all the preview information of a vendor sku. + * Gets information of the ArtifactStores under publisher. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vendorName, String skuName); + PagedIterable listByPublisher(String resourceGroupName, String publisherName); /** - * Lists all the preview information of a vendor sku. + * Gets information of the ArtifactStores under publisher. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 customer subscriptions which can use a sku as paginated response with {@link PagedIterable}. + * @return information of the ArtifactStores under publisher as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vendorName, String skuName, Context context); + PagedIterable listByPublisher(String resourceGroupName, String publisherName, Context context); /** - * Gets the preview information of a vendor sku. + * Deletes the specified artifact store. * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku along with {@link Response}. */ - Response getWithResponse( - String vendorName, String skuName, String previewSubscription, Context context); + void delete(String resourceGroupName, String publisherName, String artifactStoreName); /** - * Gets the preview information of a vendor sku. + * Deletes the specified artifact store. * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku. */ - PreviewSubscription get(String vendorName, String skuName, String previewSubscription); + void delete(String resourceGroupName, String publisherName, String artifactStoreName, Context context); /** - * Deletes the preview information of a vendor sku. + * Gets information about the specified artifact store. * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store along with {@link Response}. */ - void delete(String vendorName, String skuName, String previewSubscription); + Response getWithResponse( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); /** - * Deletes the preview information of a vendor sku. + * Gets information about the specified artifact store. * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @param previewSubscription Preview subscription ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified artifact store. */ - void delete(String vendorName, String skuName, String previewSubscription, Context context); + ArtifactStore get(String resourceGroupName, String publisherName, String artifactStoreName); /** - * Gets the preview information of a vendor sku. + * Gets information about the specified artifact store. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku along with {@link Response}. + * @return information about the specified artifact store along with {@link Response}. */ - PreviewSubscription getById(String id); + ArtifactStore getById(String id); /** - * Gets the preview information of a vendor sku. + * Gets information about the specified artifact store. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the preview information of a vendor sku along with {@link Response}. + * @return information about the specified artifact store along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes the preview information of a vendor sku. + * Deletes the specified artifact store. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ Response getWithResponse( void deleteById(String id); /** - * Deletes the preview information of a vendor sku. + * Deletes the specified artifact store. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -133,10 +133,10 @@ Response getWithResponse( void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new PreviewSubscription resource. + * Begins definition for a new ArtifactStore resource. * * @param name resource name. - * @return the first stage of the new PreviewSubscription definition. + * @return the first stage of the new ArtifactStore definition. */ - PreviewSubscription.DefinitionStages.Blank define(String name); + ArtifactStore.DefinitionStages.Blank define(String name); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactType.java new file mode 100644 index 000000000000..484bd7555f18 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ArtifactType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact type. */ +public final class ArtifactType extends ExpandableStringEnum { + /** Static value Unknown for ArtifactType. */ + public static final ArtifactType UNKNOWN = fromString("Unknown"); + + /** Static value OCIArtifact for ArtifactType. */ + public static final ArtifactType OCIARTIFACT = fromString("OCIArtifact"); + + /** Static value VhdImageFile for ArtifactType. */ + public static final ArtifactType VHD_IMAGE_FILE = fromString("VhdImageFile"); + + /** Static value ArmTemplate for ArtifactType. */ + public static final ArtifactType ARM_TEMPLATE = fromString("ArmTemplate"); + + /** Static value ImageFile for ArtifactType. */ + public static final ArtifactType IMAGE_FILE = fromString("ImageFile"); + + /** + * Creates a new instance of ArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactType() { + } + + /** + * Creates or finds a ArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactType. + */ + @JsonCreator + public static ArtifactType fromString(String name) { + return fromString(name, ArtifactType.class); + } + + /** + * Gets known ArtifactType values. + * + * @return known ArtifactType values. + */ + public static Collection values() { + return values(ArtifactType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcK8SClusterNfviDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcK8SClusterNfviDetails.java new file mode 100644 index 000000000000..1f40962f863e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcK8SClusterNfviDetails.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The AzureArcK8sCluster NFVI detail. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureArcKubernetes") +@Fluent +public final class AzureArcK8SClusterNfviDetails extends NfvIs { + /* + * The reference to the custom location. + */ + @JsonProperty(value = "customLocationReference") + private ReferencedResource customLocationReference; + + /** Creates an instance of AzureArcK8SClusterNfviDetails class. */ + public AzureArcK8SClusterNfviDetails() { + } + + /** + * Get the customLocationReference property: The reference to the custom location. + * + * @return the customLocationReference value. + */ + public ReferencedResource customLocationReference() { + return this.customLocationReference; + } + + /** + * Set the customLocationReference property: The reference to the custom location. + * + * @param customLocationReference the customLocationReference value to set. + * @return the AzureArcK8SClusterNfviDetails object itself. + */ + public AzureArcK8SClusterNfviDetails withCustomLocationReference(ReferencedResource customLocationReference) { + this.customLocationReference = customLocationReference; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcK8SClusterNfviDetails withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (customLocationReference() != null) { + customLocationReference().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactProfile.java new file mode 100644 index 000000000000..b0e0a67a1c41 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure arc kubernetes artifact profile properties. */ +@Fluent +public final class AzureArcKubernetesArtifactProfile extends ArtifactProfile { + /* + * Helm artifact profile. + */ + @JsonProperty(value = "helmArtifactProfile") + private HelmArtifactProfile helmArtifactProfile; + + /** Creates an instance of AzureArcKubernetesArtifactProfile class. */ + public AzureArcKubernetesArtifactProfile() { + } + + /** + * Get the helmArtifactProfile property: Helm artifact profile. + * + * @return the helmArtifactProfile value. + */ + public HelmArtifactProfile helmArtifactProfile() { + return this.helmArtifactProfile; + } + + /** + * Set the helmArtifactProfile property: Helm artifact profile. + * + * @param helmArtifactProfile the helmArtifactProfile value to set. + * @return the AzureArcKubernetesArtifactProfile object itself. + */ + public AzureArcKubernetesArtifactProfile withHelmArtifactProfile(HelmArtifactProfile helmArtifactProfile) { + this.helmArtifactProfile = helmArtifactProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + super.withArtifactStore(artifactStore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (helmArtifactProfile() != null) { + helmArtifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactType.java new file mode 100644 index 000000000000..16246e20ebeb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesArtifactType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact type. */ +public final class AzureArcKubernetesArtifactType extends ExpandableStringEnum { + /** Static value Unknown for AzureArcKubernetesArtifactType. */ + public static final AzureArcKubernetesArtifactType UNKNOWN = fromString("Unknown"); + + /** Static value HelmPackage for AzureArcKubernetesArtifactType. */ + public static final AzureArcKubernetesArtifactType HELM_PACKAGE = fromString("HelmPackage"); + + /** + * Creates a new instance of AzureArcKubernetesArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureArcKubernetesArtifactType() { + } + + /** + * Creates or finds a AzureArcKubernetesArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureArcKubernetesArtifactType. + */ + @JsonCreator + public static AzureArcKubernetesArtifactType fromString(String name) { + return fromString(name, AzureArcKubernetesArtifactType.class); + } + + /** + * Gets known AzureArcKubernetesArtifactType values. + * + * @return known AzureArcKubernetesArtifactType values. + */ + public static Collection values() { + return values(AzureArcKubernetesArtifactType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesDeployMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesDeployMappingRuleProfile.java new file mode 100644 index 000000000000..72f7f568bdcf --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesDeployMappingRuleProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure arc kubernetes deploy mapping rule profile. */ +@Fluent +public final class AzureArcKubernetesDeployMappingRuleProfile extends MappingRuleProfile { + /* + * The helm mapping rule profile. + */ + @JsonProperty(value = "helmMappingRuleProfile") + private HelmMappingRuleProfile helmMappingRuleProfile; + + /** Creates an instance of AzureArcKubernetesDeployMappingRuleProfile class. */ + public AzureArcKubernetesDeployMappingRuleProfile() { + } + + /** + * Get the helmMappingRuleProfile property: The helm mapping rule profile. + * + * @return the helmMappingRuleProfile value. + */ + public HelmMappingRuleProfile helmMappingRuleProfile() { + return this.helmMappingRuleProfile; + } + + /** + * Set the helmMappingRuleProfile property: The helm mapping rule profile. + * + * @param helmMappingRuleProfile the helmMappingRuleProfile value to set. + * @return the AzureArcKubernetesDeployMappingRuleProfile object itself. + */ + public AzureArcKubernetesDeployMappingRuleProfile withHelmMappingRuleProfile( + HelmMappingRuleProfile helmMappingRuleProfile) { + this.helmMappingRuleProfile = helmMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesDeployMappingRuleProfile withApplicationEnablement( + ApplicationEnablement applicationEnablement) { + super.withApplicationEnablement(applicationEnablement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (helmMappingRuleProfile() != null) { + helmMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesHelmApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesHelmApplication.java new file mode 100644 index 000000000000..09f0c92adbe7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesHelmApplication.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure arc kubernetes helm application configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("HelmPackage") +@Fluent +public final class AzureArcKubernetesHelmApplication extends AzureArcKubernetesNetworkFunctionApplication { + /* + * Azure arc kubernetes artifact profile. + */ + @JsonProperty(value = "artifactProfile") + private AzureArcKubernetesArtifactProfile artifactProfile; + + /* + * Deploy mapping rule profile. + */ + @JsonProperty(value = "deployParametersMappingRuleProfile") + private AzureArcKubernetesDeployMappingRuleProfile deployParametersMappingRuleProfile; + + /** Creates an instance of AzureArcKubernetesHelmApplication class. */ + public AzureArcKubernetesHelmApplication() { + } + + /** + * Get the artifactProfile property: Azure arc kubernetes artifact profile. + * + * @return the artifactProfile value. + */ + public AzureArcKubernetesArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Azure arc kubernetes artifact profile. + * + * @param artifactProfile the artifactProfile value to set. + * @return the AzureArcKubernetesHelmApplication object itself. + */ + public AzureArcKubernetesHelmApplication withArtifactProfile(AzureArcKubernetesArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Get the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @return the deployParametersMappingRuleProfile value. + */ + public AzureArcKubernetesDeployMappingRuleProfile deployParametersMappingRuleProfile() { + return this.deployParametersMappingRuleProfile; + } + + /** + * Set the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @param deployParametersMappingRuleProfile the deployParametersMappingRuleProfile value to set. + * @return the AzureArcKubernetesHelmApplication object itself. + */ + public AzureArcKubernetesHelmApplication withDeployParametersMappingRuleProfile( + AzureArcKubernetesDeployMappingRuleProfile deployParametersMappingRuleProfile) { + this.deployParametersMappingRuleProfile = deployParametersMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesHelmApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesHelmApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifactProfile() != null) { + artifactProfile().validate(); + } + if (deployParametersMappingRuleProfile() != null) { + deployParametersMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionApplication.java new file mode 100644 index 000000000000..e8cff61ce246 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionApplication.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure arc kubernetes network function application definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "artifactType", + defaultImpl = AzureArcKubernetesNetworkFunctionApplication.class) +@JsonTypeName("AzureArcKubernetesNetworkFunctionApplication") +@JsonSubTypes({@JsonSubTypes.Type(name = "HelmPackage", value = AzureArcKubernetesHelmApplication.class)}) +@Fluent +public class AzureArcKubernetesNetworkFunctionApplication extends NetworkFunctionApplication { + /** Creates an instance of AzureArcKubernetesNetworkFunctionApplication class. */ + public AzureArcKubernetesNetworkFunctionApplication() { + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesNetworkFunctionApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureArcKubernetesNetworkFunctionApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionTemplate.java new file mode 100644 index 000000000000..2849e5cf575c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureArcKubernetesNetworkFunctionTemplate.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Azure Arc kubernetes network function template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureArcKubernetes") +@Fluent +public final class AzureArcKubernetesNetworkFunctionTemplate extends ContainerizedNetworkFunctionTemplate { + /* + * Network function applications. + */ + @JsonProperty(value = "networkFunctionApplications") + private List networkFunctionApplications; + + /** Creates an instance of AzureArcKubernetesNetworkFunctionTemplate class. */ + public AzureArcKubernetesNetworkFunctionTemplate() { + } + + /** + * Get the networkFunctionApplications property: Network function applications. + * + * @return the networkFunctionApplications value. + */ + public List networkFunctionApplications() { + return this.networkFunctionApplications; + } + + /** + * Set the networkFunctionApplications property: Network function applications. + * + * @param networkFunctionApplications the networkFunctionApplications value to set. + * @return the AzureArcKubernetesNetworkFunctionTemplate object itself. + */ + public AzureArcKubernetesNetworkFunctionTemplate withNetworkFunctionApplications( + List networkFunctionApplications) { + this.networkFunctionApplications = networkFunctionApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFunctionApplications() != null) { + networkFunctionApplications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureContainerRegistryScopedTokenCredential.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureContainerRegistryScopedTokenCredential.java new file mode 100644 index 000000000000..e74c82aec3fb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureContainerRegistryScopedTokenCredential.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The azure container registry scoped token credential definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialType") +@JsonTypeName("AzureContainerRegistryScopedToken") +@Fluent +public final class AzureContainerRegistryScopedTokenCredential extends ArtifactAccessCredentialInner { + /* + * The username of the credential. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The credential value. + */ + @JsonProperty(value = "acrToken") + private String acrToken; + + /* + * The Acr server url + */ + @JsonProperty(value = "acrServerUrl") + private String acrServerUrl; + + /* + * The repositories that could be accessed using the current credential. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /* + * The UTC time when credential will expire. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /** Creates an instance of AzureContainerRegistryScopedTokenCredential class. */ + public AzureContainerRegistryScopedTokenCredential() { + } + + /** + * Get the username property: The username of the credential. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username of the credential. + * + * @param username the username value to set. + * @return the AzureContainerRegistryScopedTokenCredential object itself. + */ + public AzureContainerRegistryScopedTokenCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the acrToken property: The credential value. + * + * @return the acrToken value. + */ + public String acrToken() { + return this.acrToken; + } + + /** + * Set the acrToken property: The credential value. + * + * @param acrToken the acrToken value to set. + * @return the AzureContainerRegistryScopedTokenCredential object itself. + */ + public AzureContainerRegistryScopedTokenCredential withAcrToken(String acrToken) { + this.acrToken = acrToken; + return this; + } + + /** + * Get the acrServerUrl property: The Acr server url. + * + * @return the acrServerUrl value. + */ + public String acrServerUrl() { + return this.acrServerUrl; + } + + /** + * Set the acrServerUrl property: The Acr server url. + * + * @param acrServerUrl the acrServerUrl value to set. + * @return the AzureContainerRegistryScopedTokenCredential object itself. + */ + public AzureContainerRegistryScopedTokenCredential withAcrServerUrl(String acrServerUrl) { + this.acrServerUrl = acrServerUrl; + return this; + } + + /** + * Get the repositories property: The repositories that could be accessed using the current credential. + * + * @return the repositories value. + */ + public List repositories() { + return this.repositories; + } + + /** + * Set the repositories property: The repositories that could be accessed using the current credential. + * + * @param repositories the repositories value to set. + * @return the AzureContainerRegistryScopedTokenCredential object itself. + */ + public AzureContainerRegistryScopedTokenCredential withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Get the expiry property: The UTC time when credential will expire. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The UTC time when credential will expire. + * + * @param expiry the expiry value to set. + * @return the AzureContainerRegistryScopedTokenCredential object itself. + */ + public AzureContainerRegistryScopedTokenCredential withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateArtifactProfile.java new file mode 100644 index 000000000000..00fb8778087c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateArtifactProfile.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure template artifact profile properties. */ +@Fluent +public final class AzureCoreArmTemplateArtifactProfile extends ArtifactProfile { + /* + * Template artifact profile. + */ + @JsonProperty(value = "templateArtifactProfile") + private ArmTemplateArtifactProfile templateArtifactProfile; + + /** Creates an instance of AzureCoreArmTemplateArtifactProfile class. */ + public AzureCoreArmTemplateArtifactProfile() { + } + + /** + * Get the templateArtifactProfile property: Template artifact profile. + * + * @return the templateArtifactProfile value. + */ + public ArmTemplateArtifactProfile templateArtifactProfile() { + return this.templateArtifactProfile; + } + + /** + * Set the templateArtifactProfile property: Template artifact profile. + * + * @param templateArtifactProfile the templateArtifactProfile value to set. + * @return the AzureCoreArmTemplateArtifactProfile object itself. + */ + public AzureCoreArmTemplateArtifactProfile withTemplateArtifactProfile( + ArmTemplateArtifactProfile templateArtifactProfile) { + this.templateArtifactProfile = templateArtifactProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreArmTemplateArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + super.withArtifactStore(artifactStore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (templateArtifactProfile() != null) { + templateArtifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateDeployMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateDeployMappingRuleProfile.java new file mode 100644 index 000000000000..709e74c0657d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArmTemplateDeployMappingRuleProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure template deploy mapping rule profile. */ +@Fluent +public final class AzureCoreArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + /* + * The template mapping rule profile. + */ + @JsonProperty(value = "templateMappingRuleProfile") + private ArmTemplateMappingRuleProfile templateMappingRuleProfile; + + /** Creates an instance of AzureCoreArmTemplateDeployMappingRuleProfile class. */ + public AzureCoreArmTemplateDeployMappingRuleProfile() { + } + + /** + * Get the templateMappingRuleProfile property: The template mapping rule profile. + * + * @return the templateMappingRuleProfile value. + */ + public ArmTemplateMappingRuleProfile templateMappingRuleProfile() { + return this.templateMappingRuleProfile; + } + + /** + * Set the templateMappingRuleProfile property: The template mapping rule profile. + * + * @param templateMappingRuleProfile the templateMappingRuleProfile value to set. + * @return the AzureCoreArmTemplateDeployMappingRuleProfile object itself. + */ + public AzureCoreArmTemplateDeployMappingRuleProfile withTemplateMappingRuleProfile( + ArmTemplateMappingRuleProfile templateMappingRuleProfile) { + this.templateMappingRuleProfile = templateMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreArmTemplateDeployMappingRuleProfile withApplicationEnablement( + ApplicationEnablement applicationEnablement) { + super.withApplicationEnablement(applicationEnablement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (templateMappingRuleProfile() != null) { + templateMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArtifactType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArtifactType.java new file mode 100644 index 000000000000..23ae369063d7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreArtifactType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact type. */ +public final class AzureCoreArtifactType extends ExpandableStringEnum { + /** Static value Unknown for AzureCoreArtifactType. */ + public static final AzureCoreArtifactType UNKNOWN = fromString("Unknown"); + + /** Static value VhdImageFile for AzureCoreArtifactType. */ + public static final AzureCoreArtifactType VHD_IMAGE_FILE = fromString("VhdImageFile"); + + /** Static value ArmTemplate for AzureCoreArtifactType. */ + public static final AzureCoreArtifactType ARM_TEMPLATE = fromString("ArmTemplate"); + + /** + * Creates a new instance of AzureCoreArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureCoreArtifactType() { + } + + /** + * Creates or finds a AzureCoreArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureCoreArtifactType. + */ + @JsonCreator + public static AzureCoreArtifactType fromString(String name) { + return fromString(name, AzureCoreArtifactType.class); + } + + /** + * Gets known AzureCoreArtifactType values. + * + * @return known AzureCoreArtifactType values. + */ + public static Collection values() { + return values(AzureCoreArtifactType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionApplication.java new file mode 100644 index 000000000000..288231d74db9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionApplication.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure virtual network function application definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "artifactType", + defaultImpl = AzureCoreNetworkFunctionApplication.class) +@JsonTypeName("AzureCoreNetworkFunctionApplication") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "VhdImageFile", value = AzureCoreNetworkFunctionVhdApplication.class), + @JsonSubTypes.Type(name = "ArmTemplate", value = AzureCoreNetworkFunctionArmTemplateApplication.class) +}) +@Fluent +public class AzureCoreNetworkFunctionApplication extends NetworkFunctionApplication { + /** Creates an instance of AzureCoreNetworkFunctionApplication class. */ + public AzureCoreNetworkFunctionApplication() { + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionArmTemplateApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionArmTemplateApplication.java new file mode 100644 index 000000000000..a46893bf38a4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionArmTemplateApplication.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure core network function Template application definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("ArmTemplate") +@Fluent +public final class AzureCoreNetworkFunctionArmTemplateApplication extends AzureCoreNetworkFunctionApplication { + /* + * Azure template artifact profile. + */ + @JsonProperty(value = "artifactProfile") + private AzureCoreArmTemplateArtifactProfile artifactProfile; + + /* + * Deploy mapping rule profile. + */ + @JsonProperty(value = "deployParametersMappingRuleProfile") + private AzureCoreArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile; + + /** Creates an instance of AzureCoreNetworkFunctionArmTemplateApplication class. */ + public AzureCoreNetworkFunctionArmTemplateApplication() { + } + + /** + * Get the artifactProfile property: Azure template artifact profile. + * + * @return the artifactProfile value. + */ + public AzureCoreArmTemplateArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Azure template artifact profile. + * + * @param artifactProfile the artifactProfile value to set. + * @return the AzureCoreNetworkFunctionArmTemplateApplication object itself. + */ + public AzureCoreNetworkFunctionArmTemplateApplication withArtifactProfile( + AzureCoreArmTemplateArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Get the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @return the deployParametersMappingRuleProfile value. + */ + public AzureCoreArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile() { + return this.deployParametersMappingRuleProfile; + } + + /** + * Set the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @param deployParametersMappingRuleProfile the deployParametersMappingRuleProfile value to set. + * @return the AzureCoreNetworkFunctionArmTemplateApplication object itself. + */ + public AzureCoreNetworkFunctionArmTemplateApplication withDeployParametersMappingRuleProfile( + AzureCoreArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile) { + this.deployParametersMappingRuleProfile = deployParametersMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionArmTemplateApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionArmTemplateApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifactProfile() != null) { + artifactProfile().validate(); + } + if (deployParametersMappingRuleProfile() != null) { + deployParametersMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionTemplate.java new file mode 100644 index 000000000000..09a84437cfd8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionTemplate.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Azure virtual network function template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureCore") +@Fluent +public final class AzureCoreNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + /* + * Network function applications. + */ + @JsonProperty(value = "networkFunctionApplications") + private List networkFunctionApplications; + + /** Creates an instance of AzureCoreNetworkFunctionTemplate class. */ + public AzureCoreNetworkFunctionTemplate() { + } + + /** + * Get the networkFunctionApplications property: Network function applications. + * + * @return the networkFunctionApplications value. + */ + public List networkFunctionApplications() { + return this.networkFunctionApplications; + } + + /** + * Set the networkFunctionApplications property: Network function applications. + * + * @param networkFunctionApplications the networkFunctionApplications value to set. + * @return the AzureCoreNetworkFunctionTemplate object itself. + */ + public AzureCoreNetworkFunctionTemplate withNetworkFunctionApplications( + List networkFunctionApplications) { + this.networkFunctionApplications = networkFunctionApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFunctionApplications() != null) { + networkFunctionApplications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionVhdApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionVhdApplication.java new file mode 100644 index 000000000000..f63f4d06f564 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNetworkFunctionVhdApplication.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure core network function vhd application definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("VhdImageFile") +@Fluent +public final class AzureCoreNetworkFunctionVhdApplication extends AzureCoreNetworkFunctionApplication { + /* + * Azure vhd image artifact profile. + */ + @JsonProperty(value = "artifactProfile") + private AzureCoreVhdImageArtifactProfile artifactProfile; + + /* + * Deploy mapping rule profile. + */ + @JsonProperty(value = "deployParametersMappingRuleProfile") + private AzureCoreVhdImageDeployMappingRuleProfile deployParametersMappingRuleProfile; + + /** Creates an instance of AzureCoreNetworkFunctionVhdApplication class. */ + public AzureCoreNetworkFunctionVhdApplication() { + } + + /** + * Get the artifactProfile property: Azure vhd image artifact profile. + * + * @return the artifactProfile value. + */ + public AzureCoreVhdImageArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Azure vhd image artifact profile. + * + * @param artifactProfile the artifactProfile value to set. + * @return the AzureCoreNetworkFunctionVhdApplication object itself. + */ + public AzureCoreNetworkFunctionVhdApplication withArtifactProfile( + AzureCoreVhdImageArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Get the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @return the deployParametersMappingRuleProfile value. + */ + public AzureCoreVhdImageDeployMappingRuleProfile deployParametersMappingRuleProfile() { + return this.deployParametersMappingRuleProfile; + } + + /** + * Set the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @param deployParametersMappingRuleProfile the deployParametersMappingRuleProfile value to set. + * @return the AzureCoreNetworkFunctionVhdApplication object itself. + */ + public AzureCoreNetworkFunctionVhdApplication withDeployParametersMappingRuleProfile( + AzureCoreVhdImageDeployMappingRuleProfile deployParametersMappingRuleProfile) { + this.deployParametersMappingRuleProfile = deployParametersMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionVhdApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNetworkFunctionVhdApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifactProfile() != null) { + artifactProfile().validate(); + } + if (deployParametersMappingRuleProfile() != null) { + deployParametersMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNfviDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNfviDetails.java new file mode 100644 index 000000000000..61f3e118fb14 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreNfviDetails.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The Azure Core NFVI detail. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureCore") +@Fluent +public final class AzureCoreNfviDetails extends NfvIs { + /* + * Location of the Azure core. + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of AzureCoreNfviDetails class. */ + public AzureCoreNfviDetails() { + } + + /** + * Get the location property: Location of the Azure core. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the Azure core. + * + * @param location the location value to set. + * @return the AzureCoreNfviDetails object itself. + */ + public AzureCoreNfviDetails withLocation(String location) { + this.location = location; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreNfviDetails withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageArtifactProfile.java new file mode 100644 index 000000000000..1ee349682347 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure vhd artifact profile properties. */ +@Fluent +public final class AzureCoreVhdImageArtifactProfile extends ArtifactProfile { + /* + * Vhd artifact profile. + */ + @JsonProperty(value = "vhdArtifactProfile") + private VhdImageArtifactProfile vhdArtifactProfile; + + /** Creates an instance of AzureCoreVhdImageArtifactProfile class. */ + public AzureCoreVhdImageArtifactProfile() { + } + + /** + * Get the vhdArtifactProfile property: Vhd artifact profile. + * + * @return the vhdArtifactProfile value. + */ + public VhdImageArtifactProfile vhdArtifactProfile() { + return this.vhdArtifactProfile; + } + + /** + * Set the vhdArtifactProfile property: Vhd artifact profile. + * + * @param vhdArtifactProfile the vhdArtifactProfile value to set. + * @return the AzureCoreVhdImageArtifactProfile object itself. + */ + public AzureCoreVhdImageArtifactProfile withVhdArtifactProfile(VhdImageArtifactProfile vhdArtifactProfile) { + this.vhdArtifactProfile = vhdArtifactProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreVhdImageArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + super.withArtifactStore(artifactStore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vhdArtifactProfile() != null) { + vhdArtifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageDeployMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageDeployMappingRuleProfile.java new file mode 100644 index 000000000000..253aa533d278 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureCoreVhdImageDeployMappingRuleProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure vhd deploy mapping rule profile. */ +@Fluent +public final class AzureCoreVhdImageDeployMappingRuleProfile extends MappingRuleProfile { + /* + * The vhd mapping rule profile. + */ + @JsonProperty(value = "vhdImageMappingRuleProfile") + private VhdImageMappingRuleProfile vhdImageMappingRuleProfile; + + /** Creates an instance of AzureCoreVhdImageDeployMappingRuleProfile class. */ + public AzureCoreVhdImageDeployMappingRuleProfile() { + } + + /** + * Get the vhdImageMappingRuleProfile property: The vhd mapping rule profile. + * + * @return the vhdImageMappingRuleProfile value. + */ + public VhdImageMappingRuleProfile vhdImageMappingRuleProfile() { + return this.vhdImageMappingRuleProfile; + } + + /** + * Set the vhdImageMappingRuleProfile property: The vhd mapping rule profile. + * + * @param vhdImageMappingRuleProfile the vhdImageMappingRuleProfile value to set. + * @return the AzureCoreVhdImageDeployMappingRuleProfile object itself. + */ + public AzureCoreVhdImageDeployMappingRuleProfile withVhdImageMappingRuleProfile( + VhdImageMappingRuleProfile vhdImageMappingRuleProfile) { + this.vhdImageMappingRuleProfile = vhdImageMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureCoreVhdImageDeployMappingRuleProfile withApplicationEnablement( + ApplicationEnablement applicationEnablement) { + super.withApplicationEnablement(applicationEnablement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vhdImageMappingRuleProfile() != null) { + vhdImageMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateArtifactProfile.java new file mode 100644 index 000000000000..971fb39f483c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateArtifactProfile.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Operator Distributed Services vhd artifact profile properties. */ +@Fluent +public final class AzureOperatorNexusArmTemplateArtifactProfile extends ArtifactProfile { + /* + * Template artifact profile. + */ + @JsonProperty(value = "templateArtifactProfile") + private ArmTemplateArtifactProfile templateArtifactProfile; + + /** Creates an instance of AzureOperatorNexusArmTemplateArtifactProfile class. */ + public AzureOperatorNexusArmTemplateArtifactProfile() { + } + + /** + * Get the templateArtifactProfile property: Template artifact profile. + * + * @return the templateArtifactProfile value. + */ + public ArmTemplateArtifactProfile templateArtifactProfile() { + return this.templateArtifactProfile; + } + + /** + * Set the templateArtifactProfile property: Template artifact profile. + * + * @param templateArtifactProfile the templateArtifactProfile value to set. + * @return the AzureOperatorNexusArmTemplateArtifactProfile object itself. + */ + public AzureOperatorNexusArmTemplateArtifactProfile withTemplateArtifactProfile( + ArmTemplateArtifactProfile templateArtifactProfile) { + this.templateArtifactProfile = templateArtifactProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusArmTemplateArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + super.withArtifactStore(artifactStore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (templateArtifactProfile() != null) { + templateArtifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateDeployMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateDeployMappingRuleProfile.java new file mode 100644 index 000000000000..424fdb7a3cce --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArmTemplateDeployMappingRuleProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Operator Distributed Services template deploy mapping rule profile. */ +@Fluent +public final class AzureOperatorNexusArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + /* + * The template mapping rule profile. + */ + @JsonProperty(value = "templateMappingRuleProfile") + private ArmTemplateMappingRuleProfile templateMappingRuleProfile; + + /** Creates an instance of AzureOperatorNexusArmTemplateDeployMappingRuleProfile class. */ + public AzureOperatorNexusArmTemplateDeployMappingRuleProfile() { + } + + /** + * Get the templateMappingRuleProfile property: The template mapping rule profile. + * + * @return the templateMappingRuleProfile value. + */ + public ArmTemplateMappingRuleProfile templateMappingRuleProfile() { + return this.templateMappingRuleProfile; + } + + /** + * Set the templateMappingRuleProfile property: The template mapping rule profile. + * + * @param templateMappingRuleProfile the templateMappingRuleProfile value to set. + * @return the AzureOperatorNexusArmTemplateDeployMappingRuleProfile object itself. + */ + public AzureOperatorNexusArmTemplateDeployMappingRuleProfile withTemplateMappingRuleProfile( + ArmTemplateMappingRuleProfile templateMappingRuleProfile) { + this.templateMappingRuleProfile = templateMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusArmTemplateDeployMappingRuleProfile withApplicationEnablement( + ApplicationEnablement applicationEnablement) { + super.withApplicationEnablement(applicationEnablement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (templateMappingRuleProfile() != null) { + templateMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArtifactType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArtifactType.java new file mode 100644 index 000000000000..c1b4f3f12c57 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusArtifactType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The artifact type. */ +public final class AzureOperatorNexusArtifactType extends ExpandableStringEnum { + /** Static value Unknown for AzureOperatorNexusArtifactType. */ + public static final AzureOperatorNexusArtifactType UNKNOWN = fromString("Unknown"); + + /** Static value ImageFile for AzureOperatorNexusArtifactType. */ + public static final AzureOperatorNexusArtifactType IMAGE_FILE = fromString("ImageFile"); + + /** Static value ArmTemplate for AzureOperatorNexusArtifactType. */ + public static final AzureOperatorNexusArtifactType ARM_TEMPLATE = fromString("ArmTemplate"); + + /** + * Creates a new instance of AzureOperatorNexusArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureOperatorNexusArtifactType() { + } + + /** + * Creates or finds a AzureOperatorNexusArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureOperatorNexusArtifactType. + */ + @JsonCreator + public static AzureOperatorNexusArtifactType fromString(String name) { + return fromString(name, AzureOperatorNexusArtifactType.class); + } + + /** + * Gets known AzureOperatorNexusArtifactType values. + * + * @return known AzureOperatorNexusArtifactType values. + */ + public static Collection values() { + return values(AzureOperatorNexusArtifactType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusClusterNfviDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusClusterNfviDetails.java new file mode 100644 index 000000000000..1ceca671293b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusClusterNfviDetails.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The AzureOperatorNexusCluster NFVI detail. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureOperatorNexus") +@Fluent +public final class AzureOperatorNexusClusterNfviDetails extends NfvIs { + /* + * The reference to the custom location. + */ + @JsonProperty(value = "customLocationReference") + private ReferencedResource customLocationReference; + + /** Creates an instance of AzureOperatorNexusClusterNfviDetails class. */ + public AzureOperatorNexusClusterNfviDetails() { + } + + /** + * Get the customLocationReference property: The reference to the custom location. + * + * @return the customLocationReference value. + */ + public ReferencedResource customLocationReference() { + return this.customLocationReference; + } + + /** + * Set the customLocationReference property: The reference to the custom location. + * + * @param customLocationReference the customLocationReference value to set. + * @return the AzureOperatorNexusClusterNfviDetails object itself. + */ + public AzureOperatorNexusClusterNfviDetails withCustomLocationReference( + ReferencedResource customLocationReference) { + this.customLocationReference = customLocationReference; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusClusterNfviDetails withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (customLocationReference() != null) { + customLocationReference().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageArtifactProfile.java new file mode 100644 index 000000000000..1d4964b5c603 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Operator Distributed Services image artifact profile properties. */ +@Fluent +public final class AzureOperatorNexusImageArtifactProfile extends ArtifactProfile { + /* + * Image artifact profile. + */ + @JsonProperty(value = "imageArtifactProfile") + private ImageArtifactProfile imageArtifactProfile; + + /** Creates an instance of AzureOperatorNexusImageArtifactProfile class. */ + public AzureOperatorNexusImageArtifactProfile() { + } + + /** + * Get the imageArtifactProfile property: Image artifact profile. + * + * @return the imageArtifactProfile value. + */ + public ImageArtifactProfile imageArtifactProfile() { + return this.imageArtifactProfile; + } + + /** + * Set the imageArtifactProfile property: Image artifact profile. + * + * @param imageArtifactProfile the imageArtifactProfile value to set. + * @return the AzureOperatorNexusImageArtifactProfile object itself. + */ + public AzureOperatorNexusImageArtifactProfile withImageArtifactProfile(ImageArtifactProfile imageArtifactProfile) { + this.imageArtifactProfile = imageArtifactProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusImageArtifactProfile withArtifactStore(ReferencedResource artifactStore) { + super.withArtifactStore(artifactStore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (imageArtifactProfile() != null) { + imageArtifactProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageDeployMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageDeployMappingRuleProfile.java new file mode 100644 index 000000000000..4c50ef5095b3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusImageDeployMappingRuleProfile.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Operator Distributed Services image deploy mapping rule profile. */ +@Fluent +public final class AzureOperatorNexusImageDeployMappingRuleProfile extends MappingRuleProfile { + /* + * The vhd mapping rule profile. + */ + @JsonProperty(value = "imageMappingRuleProfile") + private ImageMappingRuleProfile imageMappingRuleProfile; + + /** Creates an instance of AzureOperatorNexusImageDeployMappingRuleProfile class. */ + public AzureOperatorNexusImageDeployMappingRuleProfile() { + } + + /** + * Get the imageMappingRuleProfile property: The vhd mapping rule profile. + * + * @return the imageMappingRuleProfile value. + */ + public ImageMappingRuleProfile imageMappingRuleProfile() { + return this.imageMappingRuleProfile; + } + + /** + * Set the imageMappingRuleProfile property: The vhd mapping rule profile. + * + * @param imageMappingRuleProfile the imageMappingRuleProfile value to set. + * @return the AzureOperatorNexusImageDeployMappingRuleProfile object itself. + */ + public AzureOperatorNexusImageDeployMappingRuleProfile withImageMappingRuleProfile( + ImageMappingRuleProfile imageMappingRuleProfile) { + this.imageMappingRuleProfile = imageMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusImageDeployMappingRuleProfile withApplicationEnablement( + ApplicationEnablement applicationEnablement) { + super.withApplicationEnablement(applicationEnablement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (imageMappingRuleProfile() != null) { + imageMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionApplication.java new file mode 100644 index 000000000000..4bea607bd4d3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionApplication.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure Operator Distributed Services network function application definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "artifactType", + defaultImpl = AzureOperatorNexusNetworkFunctionApplication.class) +@JsonTypeName("AzureOperatorNexusNetworkFunctionApplication") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ImageFile", value = AzureOperatorNexusNetworkFunctionImageApplication.class), + @JsonSubTypes.Type(name = "ArmTemplate", value = AzureOperatorNexusNetworkFunctionArmTemplateApplication.class) +}) +@Fluent +public class AzureOperatorNexusNetworkFunctionApplication extends NetworkFunctionApplication { + /** Creates an instance of AzureOperatorNexusNetworkFunctionApplication class. */ + public AzureOperatorNexusNetworkFunctionApplication() { + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionArmTemplateApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionArmTemplateApplication.java new file mode 100644 index 000000000000..dad98ae1353e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionArmTemplateApplication.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure Operator Distributed Services network function Template application definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("ArmTemplate") +@Fluent +public final class AzureOperatorNexusNetworkFunctionArmTemplateApplication + extends AzureOperatorNexusNetworkFunctionApplication { + /* + * Azure Operator Distributed Services Template artifact profile. + */ + @JsonProperty(value = "artifactProfile") + private AzureOperatorNexusArmTemplateArtifactProfile artifactProfile; + + /* + * Deploy mapping rule profile. + */ + @JsonProperty(value = "deployParametersMappingRuleProfile") + private AzureOperatorNexusArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile; + + /** Creates an instance of AzureOperatorNexusNetworkFunctionArmTemplateApplication class. */ + public AzureOperatorNexusNetworkFunctionArmTemplateApplication() { + } + + /** + * Get the artifactProfile property: Azure Operator Distributed Services Template artifact profile. + * + * @return the artifactProfile value. + */ + public AzureOperatorNexusArmTemplateArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Azure Operator Distributed Services Template artifact profile. + * + * @param artifactProfile the artifactProfile value to set. + * @return the AzureOperatorNexusNetworkFunctionArmTemplateApplication object itself. + */ + public AzureOperatorNexusNetworkFunctionArmTemplateApplication withArtifactProfile( + AzureOperatorNexusArmTemplateArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Get the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @return the deployParametersMappingRuleProfile value. + */ + public AzureOperatorNexusArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile() { + return this.deployParametersMappingRuleProfile; + } + + /** + * Set the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @param deployParametersMappingRuleProfile the deployParametersMappingRuleProfile value to set. + * @return the AzureOperatorNexusNetworkFunctionArmTemplateApplication object itself. + */ + public AzureOperatorNexusNetworkFunctionArmTemplateApplication withDeployParametersMappingRuleProfile( + AzureOperatorNexusArmTemplateDeployMappingRuleProfile deployParametersMappingRuleProfile) { + this.deployParametersMappingRuleProfile = deployParametersMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionArmTemplateApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionArmTemplateApplication withDependsOnProfile( + DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifactProfile() != null) { + artifactProfile().validate(); + } + if (deployParametersMappingRuleProfile() != null) { + deployParametersMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionImageApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionImageApplication.java new file mode 100644 index 000000000000..6f98d0a42d1e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionImageApplication.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure Operator Distributed Services network function image application definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("ImageFile") +@Fluent +public final class AzureOperatorNexusNetworkFunctionImageApplication + extends AzureOperatorNexusNetworkFunctionApplication { + /* + * Azure Operator Distributed Services image artifact profile. + */ + @JsonProperty(value = "artifactProfile") + private AzureOperatorNexusImageArtifactProfile artifactProfile; + + /* + * Deploy mapping rule profile. + */ + @JsonProperty(value = "deployParametersMappingRuleProfile") + private AzureOperatorNexusImageDeployMappingRuleProfile deployParametersMappingRuleProfile; + + /** Creates an instance of AzureOperatorNexusNetworkFunctionImageApplication class. */ + public AzureOperatorNexusNetworkFunctionImageApplication() { + } + + /** + * Get the artifactProfile property: Azure Operator Distributed Services image artifact profile. + * + * @return the artifactProfile value. + */ + public AzureOperatorNexusImageArtifactProfile artifactProfile() { + return this.artifactProfile; + } + + /** + * Set the artifactProfile property: Azure Operator Distributed Services image artifact profile. + * + * @param artifactProfile the artifactProfile value to set. + * @return the AzureOperatorNexusNetworkFunctionImageApplication object itself. + */ + public AzureOperatorNexusNetworkFunctionImageApplication withArtifactProfile( + AzureOperatorNexusImageArtifactProfile artifactProfile) { + this.artifactProfile = artifactProfile; + return this; + } + + /** + * Get the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @return the deployParametersMappingRuleProfile value. + */ + public AzureOperatorNexusImageDeployMappingRuleProfile deployParametersMappingRuleProfile() { + return this.deployParametersMappingRuleProfile; + } + + /** + * Set the deployParametersMappingRuleProfile property: Deploy mapping rule profile. + * + * @param deployParametersMappingRuleProfile the deployParametersMappingRuleProfile value to set. + * @return the AzureOperatorNexusNetworkFunctionImageApplication object itself. + */ + public AzureOperatorNexusNetworkFunctionImageApplication withDeployParametersMappingRuleProfile( + AzureOperatorNexusImageDeployMappingRuleProfile deployParametersMappingRuleProfile) { + this.deployParametersMappingRuleProfile = deployParametersMappingRuleProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionImageApplication withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureOperatorNexusNetworkFunctionImageApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifactProfile() != null) { + artifactProfile().validate(); + } + if (deployParametersMappingRuleProfile() != null) { + deployParametersMappingRuleProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionTemplate.java new file mode 100644 index 000000000000..c12b1a17f066 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureOperatorNexusNetworkFunctionTemplate.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Azure Operator Distributed Services network function template. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nfviType") +@JsonTypeName("AzureOperatorNexus") +@Fluent +public final class AzureOperatorNexusNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + /* + * Network function applications. + */ + @JsonProperty(value = "networkFunctionApplications") + private List networkFunctionApplications; + + /** Creates an instance of AzureOperatorNexusNetworkFunctionTemplate class. */ + public AzureOperatorNexusNetworkFunctionTemplate() { + } + + /** + * Get the networkFunctionApplications property: Network function applications. + * + * @return the networkFunctionApplications value. + */ + public List networkFunctionApplications() { + return this.networkFunctionApplications; + } + + /** + * Set the networkFunctionApplications property: Network function applications. + * + * @param networkFunctionApplications the networkFunctionApplications value to set. + * @return the AzureOperatorNexusNetworkFunctionTemplate object itself. + */ + public AzureOperatorNexusNetworkFunctionTemplate withNetworkFunctionApplications( + List networkFunctionApplications) { + this.networkFunctionApplications = networkFunctionApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFunctionApplications() != null) { + networkFunctionApplications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStackEdgeFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStackEdgeFormat.java deleted file mode 100644 index 079571fc59eb..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStackEdgeFormat.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The reference to the Azure stack edge device. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deviceType") -@JsonTypeName("AzureStackEdge") -@Fluent -public final class AzureStackEdgeFormat extends DevicePropertiesFormat { - /* - * The reference to the Azure stack edge device. - */ - @JsonProperty(value = "azureStackEdge", required = true) - private SubResource azureStackEdge; - - /** Creates an instance of AzureStackEdgeFormat class. */ - public AzureStackEdgeFormat() { - } - - /** - * Get the azureStackEdge property: The reference to the Azure stack edge device. - * - * @return the azureStackEdge value. - */ - public SubResource azureStackEdge() { - return this.azureStackEdge; - } - - /** - * Set the azureStackEdge property: The reference to the Azure stack edge device. - * - * @param azureStackEdge the azureStackEdge value to set. - * @return the AzureStackEdgeFormat object itself. - */ - public AzureStackEdgeFormat withAzureStackEdge(SubResource azureStackEdge) { - this.azureStackEdge = azureStackEdge; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (azureStackEdge() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azureStackEdge in model AzureStackEdgeFormat")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AzureStackEdgeFormat.class); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountContainerCredential.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountContainerCredential.java new file mode 100644 index 000000000000..d87fe8aed234 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountContainerCredential.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The azure storage account container credential definition. */ +@Fluent +public final class AzureStorageAccountContainerCredential { + /* + * The storage account container name + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The storage account container sas uri + */ + @JsonProperty(value = "containerSasUri") + private String containerSasUri; + + /** Creates an instance of AzureStorageAccountContainerCredential class. */ + public AzureStorageAccountContainerCredential() { + } + + /** + * Get the containerName property: The storage account container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The storage account container name. + * + * @param containerName the containerName value to set. + * @return the AzureStorageAccountContainerCredential object itself. + */ + public AzureStorageAccountContainerCredential withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerSasUri property: The storage account container sas uri. + * + * @return the containerSasUri value. + */ + public String containerSasUri() { + return this.containerSasUri; + } + + /** + * Set the containerSasUri property: The storage account container sas uri. + * + * @param containerSasUri the containerSasUri value to set. + * @return the AzureStorageAccountContainerCredential object itself. + */ + public AzureStorageAccountContainerCredential withContainerSasUri(String containerSasUri) { + this.containerSasUri = containerSasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountCredential.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountCredential.java new file mode 100644 index 000000000000..2f6a3553bd1d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/AzureStorageAccountCredential.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The azure storage account credential definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialType") +@JsonTypeName("AzureStorageAccountToken") +@Fluent +public final class AzureStorageAccountCredential extends ArtifactAccessCredentialInner { + /* + * The storage account Id + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The containers that could be accessed using the current credential. + */ + @JsonProperty(value = "containerCredentials") + private List containerCredentials; + + /* + * The UTC time when credential will expire. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /** Creates an instance of AzureStorageAccountCredential class. */ + public AzureStorageAccountCredential() { + } + + /** + * Get the storageAccountId property: The storage account Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account Id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the AzureStorageAccountCredential object itself. + */ + public AzureStorageAccountCredential withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the containerCredentials property: The containers that could be accessed using the current credential. + * + * @return the containerCredentials value. + */ + public List containerCredentials() { + return this.containerCredentials; + } + + /** + * Set the containerCredentials property: The containers that could be accessed using the current credential. + * + * @param containerCredentials the containerCredentials value to set. + * @return the AzureStorageAccountCredential object itself. + */ + public AzureStorageAccountCredential withContainerCredentials( + List containerCredentials) { + this.containerCredentials = containerCredentials; + return this; + } + + /** + * Get the expiry property: The UTC time when credential will expire. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The UTC time when credential will expire. + * + * @param expiry the expiry value to set. + * @return the AzureStorageAccountCredential object itself. + */ + public AzureStorageAccountCredential withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (containerCredentials() != null) { + containerCredentials().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Component.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Component.java new file mode 100644 index 000000000000..f518c0978b27 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Component.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; + +/** An immutable client-side representation of Component. */ +public interface Component { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The component properties. + * + * @return the properties value. + */ + ComponentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner object. + * + * @return the inner object. + */ + ComponentInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentListResult.java similarity index 62% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentListResult.java index 6430e350a946..bad44dba5276 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuListResult.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of available network function skus. */ +/** Response for list component API service call. */ @Fluent -public final class NetworkFunctionSkuListResult { +public final class ComponentListResult { /* - * The network function vendor sku overview properties. + * A list of component resources in a networkFunction. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class NetworkFunctionSkuListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of NetworkFunctionSkuListResult class. */ - public NetworkFunctionSkuListResult() { + /** Creates an instance of ComponentListResult class. */ + public ComponentListResult() { } /** - * Get the value property: The network function vendor sku overview properties. + * Get the value property: A list of component resources in a networkFunction. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: The network function vendor sku overview properties. + * Set the value property: A list of component resources in a networkFunction. * * @param value the value value to set. - * @return the NetworkFunctionSkuListResult object itself. + * @return the ComponentListResult object itself. */ - public NetworkFunctionSkuListResult withValue(List value) { + public ComponentListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentProperties.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentProperties.java new file mode 100644 index 000000000000..2fec331203d6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ComponentProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The component properties of the network function. */ +@Immutable +public final class ComponentProperties { + /* + * The provisioning state of the component resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The JSON-serialized deployment profile of the component resource. + */ + @JsonProperty(value = "deploymentProfile", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentProfile; + + /* + * The deployment status of the component resource. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatusProperties deploymentStatus; + + /** Creates an instance of ComponentProperties class. */ + public ComponentProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the component resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentProfile property: The JSON-serialized deployment profile of the component resource. + * + * @return the deploymentProfile value. + */ + public String deploymentProfile() { + return this.deploymentProfile; + } + + /** + * Get the deploymentStatus property: The deployment status of the component resource. + * + * @return the deploymentStatus value. + */ + public DeploymentStatusProperties deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deploymentStatus() != null) { + deploymentStatus().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Components.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Components.java new file mode 100644 index 000000000000..3f76cf5304f9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Components.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 Components. */ +public interface Components { + /** + * Gets information about the specified application instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application instance resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkFunctionName, String componentName, Context context); + + /** + * Gets information about the specified application instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param componentName The name of the component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application instance resource. + */ + Component get(String resourceGroupName, String networkFunctionName, String componentName); + + /** + * Lists all the component resources in a network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list component API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkFunction(String resourceGroupName, String networkFunctionName); + + /** + * Lists all the component resources in a network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list component API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkFunction( + String resourceGroupName, String networkFunctionName, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchema.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchema.java new file mode 100644 index 000000000000..2b1dcc7281c9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchema.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import java.util.Map; + +/** An immutable client-side representation of ConfigurationGroupSchema. */ +public interface ConfigurationGroupSchema { + /** + * 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: Configuration group schema properties. + * + * @return the properties value. + */ + ConfigurationGroupSchemaPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner object. + * + * @return the inner object. + */ + ConfigurationGroupSchemaInner innerModel(); + + /** The entirety of the ConfigurationGroupSchema definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The ConfigurationGroupSchema definition stages. */ + interface DefinitionStages { + /** The first stage of the ConfigurationGroupSchema definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ConfigurationGroupSchema 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the ConfigurationGroupSchema definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @return the next definition stage. + */ + WithCreate withExistingPublisher(String resourceGroupName, String publisherName); + } + + /** + * The stage of the ConfigurationGroupSchema 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigurationGroupSchema create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigurationGroupSchema create(Context context); + } + + /** The stage of the ConfigurationGroupSchema 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 ConfigurationGroupSchema definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Configuration group schema properties.. + * + * @param properties Configuration group schema properties. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigurationGroupSchemaPropertiesFormat properties); + } + } + + /** + * Begins update for the ConfigurationGroupSchema resource. + * + * @return the stage of resource update. + */ + ConfigurationGroupSchema.Update update(); + + /** The template for ConfigurationGroupSchema update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigurationGroupSchema apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigurationGroupSchema apply(Context context); + } + + /** The ConfigurationGroupSchema update stages. */ + interface UpdateStages { + /** The stage of the ConfigurationGroupSchema 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigurationGroupSchema refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigurationGroupSchema refresh(Context context); + + /** + * Update configuration group schema state. + * + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + ConfigurationGroupSchemaVersionUpdateState updateState(ConfigurationGroupSchemaVersionUpdateStateInner parameters); + + /** + * Update configuration group schema state. + * + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + ConfigurationGroupSchemaVersionUpdateState updateState( + ConfigurationGroupSchemaVersionUpdateStateInner parameters, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaListResult.java new file mode 100644 index 000000000000..1317ee4883a2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of configuration group schema resources. */ +@Fluent +public final class ConfigurationGroupSchemaListResult { + /* + * A list of configuration group schema. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ConfigurationGroupSchemaListResult class. */ + public ConfigurationGroupSchemaListResult() { + } + + /** + * Get the value property: A list of configuration group schema. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of configuration group schema. + * + * @param value the value value to set. + * @return the ConfigurationGroupSchemaListResult object itself. + */ + public ConfigurationGroupSchemaListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaPropertiesFormat.java new file mode 100644 index 000000000000..6655cd6fcbfc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaPropertiesFormat.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration group schema properties. */ +@Fluent +public final class ConfigurationGroupSchemaPropertiesFormat { + /* + * The provisioning state of the Configuration group schema resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The configuration group schema version state. + */ + @JsonProperty(value = "versionState", access = JsonProperty.Access.WRITE_ONLY) + private VersionState versionState; + + /* + * Description of what schema can contain. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + */ + @JsonProperty(value = "schemaDefinition") + private String schemaDefinition; + + /** Creates an instance of ConfigurationGroupSchemaPropertiesFormat class. */ + public ConfigurationGroupSchemaPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the Configuration group schema resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the versionState property: The configuration group schema version state. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Get the description property: Description of what schema can contain. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of what schema can contain. + * + * @param description the description value to set. + * @return the ConfigurationGroupSchemaPropertiesFormat object itself. + */ + public ConfigurationGroupSchemaPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the schemaDefinition property: Name and value pairs that define the configuration value. It can be a well + * formed escaped JSON string. + * + * @return the schemaDefinition value. + */ + public String schemaDefinition() { + return this.schemaDefinition; + } + + /** + * Set the schemaDefinition property: Name and value pairs that define the configuration value. It can be a well + * formed escaped JSON string. + * + * @param schemaDefinition the schemaDefinition value to set. + * @return the ConfigurationGroupSchemaPropertiesFormat object itself. + */ + public ConfigurationGroupSchemaPropertiesFormat withSchemaDefinition(String schemaDefinition) { + this.schemaDefinition = schemaDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaVersionUpdateState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaVersionUpdateState.java new file mode 100644 index 000000000000..1df1e7a68f4a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemaVersionUpdateState.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.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; + +/** An immutable client-side representation of ConfigurationGroupSchemaVersionUpdateState. */ +public interface ConfigurationGroupSchemaVersionUpdateState { + /** + * Gets the versionState property: The configuration group schema state. + * + * @return the versionState value. + */ + VersionState versionState(); + + /** + * Gets the inner + * com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner object. + * + * @return the inner object. + */ + ConfigurationGroupSchemaVersionUpdateStateInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemas.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemas.java new file mode 100644 index 000000000000..47eacf286bf3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupSchemas.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.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; + +/** Resource collection API of ConfigurationGroupSchemas. */ +public interface ConfigurationGroupSchemas { + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the configuration group schemas under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the configuration group schemas under a publisher as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String configurationGroupSchemaName); + + /** + * Deletes a specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String configurationGroupSchemaName, Context context); + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String publisherName, String configurationGroupSchemaName, Context context); + + /** + * Gets information about the specified configuration group schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified configuration group schema. + */ + ConfigurationGroupSchema get(String resourceGroupName, String publisherName, String configurationGroupSchemaName); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + ConfigurationGroupSchemaVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters); + + /** + * Update configuration group schema state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param configurationGroupSchemaName The name of the configuration group schema. + * @param parameters Parameters supplied to update the state of configuration group schema. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher configuration group schema update request definition. + */ + ConfigurationGroupSchemaVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String configurationGroupSchemaName, + ConfigurationGroupSchemaVersionUpdateStateInner parameters, + Context context); + + /** + * Gets information about the specified configuration group schema. + * + * @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 information about the specified configuration group schema along with {@link Response}. + */ + ConfigurationGroupSchema getById(String id); + + /** + * Gets information about the specified configuration group schema. + * + * @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 information about the specified configuration group schema along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified configuration group schema. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified configuration group schema. + * + * @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 ConfigurationGroupSchema resource. + * + * @param name resource name. + * @return the first stage of the new ConfigurationGroupSchema definition. + */ + ConfigurationGroupSchema.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValue.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValue.java new file mode 100644 index 000000000000..69f840d6c5d9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValue.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import java.util.Map; + +/** An immutable client-side representation of ConfigurationGroupValue. */ +public interface ConfigurationGroupValue { + /** + * 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: Hybrid configuration group value properties. + * + * @return the properties value. + */ + ConfigurationGroupValuePropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.ConfigurationGroupValueInner object. + * + * @return the inner object. + */ + ConfigurationGroupValueInner innerModel(); + + /** The entirety of the ConfigurationGroupValue definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The ConfigurationGroupValue definition stages. */ + interface DefinitionStages { + /** The first stage of the ConfigurationGroupValue definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ConfigurationGroupValue 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 ConfigurationGroupValue 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 ConfigurationGroupValue 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigurationGroupValue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigurationGroupValue create(Context context); + } + + /** The stage of the ConfigurationGroupValue 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 ConfigurationGroupValue definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Hybrid configuration group value properties.. + * + * @param properties Hybrid configuration group value properties. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigurationGroupValuePropertiesFormat properties); + } + } + + /** + * Begins update for the ConfigurationGroupValue resource. + * + * @return the stage of resource update. + */ + ConfigurationGroupValue.Update update(); + + /** The template for ConfigurationGroupValue update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigurationGroupValue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigurationGroupValue apply(Context context); + } + + /** The ConfigurationGroupValue update stages. */ + interface UpdateStages { + /** The stage of the ConfigurationGroupValue 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigurationGroupValue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigurationGroupValue refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueConfigurationType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueConfigurationType.java new file mode 100644 index 000000000000..72746f22f871 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueConfigurationType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The secret type which indicates if secret or not. */ +public final class ConfigurationGroupValueConfigurationType + extends ExpandableStringEnum { + /** Static value Unknown for ConfigurationGroupValueConfigurationType. */ + public static final ConfigurationGroupValueConfigurationType UNKNOWN = fromString("Unknown"); + + /** Static value Secret for ConfigurationGroupValueConfigurationType. */ + public static final ConfigurationGroupValueConfigurationType SECRET = fromString("Secret"); + + /** Static value Open for ConfigurationGroupValueConfigurationType. */ + public static final ConfigurationGroupValueConfigurationType OPEN = fromString("Open"); + + /** + * Creates a new instance of ConfigurationGroupValueConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationGroupValueConfigurationType() { + } + + /** + * Creates or finds a ConfigurationGroupValueConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationGroupValueConfigurationType. + */ + @JsonCreator + public static ConfigurationGroupValueConfigurationType fromString(String name) { + return fromString(name, ConfigurationGroupValueConfigurationType.class); + } + + /** + * Gets known ConfigurationGroupValueConfigurationType values. + * + * @return known ConfigurationGroupValueConfigurationType values. + */ + public static Collection values() { + return values(ConfigurationGroupValueConfigurationType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueListResult.java new file mode 100644 index 000000000000..6e9e35e5f0e9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValueListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for hybrid configurationGroups API service call. */ +@Fluent +public final class ConfigurationGroupValueListResult { + /* + * A list of hybrid configurationGroups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ConfigurationGroupValueListResult class. */ + public ConfigurationGroupValueListResult() { + } + + /** + * Get the value property: A list of hybrid configurationGroups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of hybrid configurationGroups. + * + * @param value the value value to set. + * @return the ConfigurationGroupValueListResult object itself. + */ + public ConfigurationGroupValueListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValuePropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValuePropertiesFormat.java new file mode 100644 index 000000000000..e8b9aa03701f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValuePropertiesFormat.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Hybrid configuration group value properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "configurationType", + defaultImpl = ConfigurationGroupValuePropertiesFormat.class) +@JsonTypeName("ConfigurationGroupValuePropertiesFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Secret", value = ConfigurationValueWithSecrets.class), + @JsonSubTypes.Type(name = "Open", value = ConfigurationValueWithoutSecrets.class) +}) +@Fluent +public class ConfigurationGroupValuePropertiesFormat { + /* + * The provisioning state of the site resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The publisher name for the configuration group schema. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * The scope of the publisher. + */ + @JsonProperty(value = "publisherScope", access = JsonProperty.Access.WRITE_ONLY) + private PublisherScope publisherScope; + + /* + * The configuration group schema name. + */ + @JsonProperty(value = "configurationGroupSchemaName", access = JsonProperty.Access.WRITE_ONLY) + private String configurationGroupSchemaName; + + /* + * The location of the configuration group schema offering. + */ + @JsonProperty(value = "configurationGroupSchemaOfferingLocation", access = JsonProperty.Access.WRITE_ONLY) + private String configurationGroupSchemaOfferingLocation; + + /* + * The configuration group schema resource reference. + */ + @JsonProperty(value = "configurationGroupSchemaResourceReference") + private DeploymentResourceIdReference configurationGroupSchemaResourceReference; + + /** Creates an instance of ConfigurationGroupValuePropertiesFormat class. */ + public ConfigurationGroupValuePropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the site resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherName property: The publisher name for the configuration group schema. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the publisherScope property: The scope of the publisher. + * + * @return the publisherScope value. + */ + public PublisherScope publisherScope() { + return this.publisherScope; + } + + /** + * Get the configurationGroupSchemaName property: The configuration group schema name. + * + * @return the configurationGroupSchemaName value. + */ + public String configurationGroupSchemaName() { + return this.configurationGroupSchemaName; + } + + /** + * Get the configurationGroupSchemaOfferingLocation property: The location of the configuration group schema + * offering. + * + * @return the configurationGroupSchemaOfferingLocation value. + */ + public String configurationGroupSchemaOfferingLocation() { + return this.configurationGroupSchemaOfferingLocation; + } + + /** + * Get the configurationGroupSchemaResourceReference property: The configuration group schema resource reference. + * + * @return the configurationGroupSchemaResourceReference value. + */ + public DeploymentResourceIdReference configurationGroupSchemaResourceReference() { + return this.configurationGroupSchemaResourceReference; + } + + /** + * Set the configurationGroupSchemaResourceReference property: The configuration group schema resource reference. + * + * @param configurationGroupSchemaResourceReference the configurationGroupSchemaResourceReference value to set. + * @return the ConfigurationGroupValuePropertiesFormat object itself. + */ + public ConfigurationGroupValuePropertiesFormat withConfigurationGroupSchemaResourceReference( + DeploymentResourceIdReference configurationGroupSchemaResourceReference) { + this.configurationGroupSchemaResourceReference = configurationGroupSchemaResourceReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurationGroupSchemaResourceReference() != null) { + configurationGroupSchemaResourceReference().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValues.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValues.java new file mode 100644 index 000000000000..f3ad213b63af --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationGroupValues.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 ConfigurationGroupValues. */ +public interface ConfigurationGroupValues { + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 configurationGroupValueName); + + /** + * Deletes the specified hybrid configuration group value. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 configurationGroupValueName, Context context); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String configurationGroupValueName, Context context); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationGroupValueName The name of the configuration group value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified hybrid configuration group values. + */ + ConfigurationGroupValue getByResourceGroup(String resourceGroupName, String configurationGroupValueName); + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all sites in the configuration group value in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the hybrid network configurationGroupValues in a 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 response for hybrid configurationGroups API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @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 information about the specified hybrid configuration group values along with {@link Response}. + */ + ConfigurationGroupValue getById(String id); + + /** + * Gets information about the specified hybrid configuration group values. + * + * @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 information about the specified hybrid configuration group values along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified hybrid configuration group value. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified hybrid configuration group value. + * + * @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 ConfigurationGroupValue resource. + * + * @param name resource name. + * @return the first stage of the new ConfigurationGroupValue definition. + */ + ConfigurationGroupValue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithSecrets.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithSecrets.java new file mode 100644 index 000000000000..817c885c6aef --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithSecrets.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The ConfigurationValue with secrets. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Secret") +@Fluent +public final class ConfigurationValueWithSecrets extends ConfigurationGroupValuePropertiesFormat { + /* + * Name and value pairs that define the configuration value secrets. It can be a well formed escaped JSON string. + */ + @JsonProperty(value = "secretConfigurationValue") + private String secretConfigurationValue; + + /** Creates an instance of ConfigurationValueWithSecrets class. */ + public ConfigurationValueWithSecrets() { + } + + /** + * Get the secretConfigurationValue property: Name and value pairs that define the configuration value secrets. It + * can be a well formed escaped JSON string. + * + * @return the secretConfigurationValue value. + */ + public String secretConfigurationValue() { + return this.secretConfigurationValue; + } + + /** + * Set the secretConfigurationValue property: Name and value pairs that define the configuration value secrets. It + * can be a well formed escaped JSON string. + * + * @param secretConfigurationValue the secretConfigurationValue value to set. + * @return the ConfigurationValueWithSecrets object itself. + */ + public ConfigurationValueWithSecrets withSecretConfigurationValue(String secretConfigurationValue) { + this.secretConfigurationValue = secretConfigurationValue; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationValueWithSecrets withConfigurationGroupSchemaResourceReference( + DeploymentResourceIdReference configurationGroupSchemaResourceReference) { + super.withConfigurationGroupSchemaResourceReference(configurationGroupSchemaResourceReference); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithoutSecrets.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithoutSecrets.java new file mode 100644 index 000000000000..0fba6d3fcc72 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ConfigurationValueWithoutSecrets.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The ConfigurationValue with no secrets. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Open") +@Fluent +public final class ConfigurationValueWithoutSecrets extends ConfigurationGroupValuePropertiesFormat { + /* + * Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + */ + @JsonProperty(value = "configurationValue") + private String configurationValue; + + /** Creates an instance of ConfigurationValueWithoutSecrets class. */ + public ConfigurationValueWithoutSecrets() { + } + + /** + * Get the configurationValue property: Name and value pairs that define the configuration value. It can be a well + * formed escaped JSON string. + * + * @return the configurationValue value. + */ + public String configurationValue() { + return this.configurationValue; + } + + /** + * Set the configurationValue property: Name and value pairs that define the configuration value. It can be a well + * formed escaped JSON string. + * + * @param configurationValue the configurationValue value to set. + * @return the ConfigurationValueWithoutSecrets object itself. + */ + public ConfigurationValueWithoutSecrets withConfigurationValue(String configurationValue) { + this.configurationValue = configurationValue; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConfigurationValueWithoutSecrets withConfigurationGroupSchemaResourceReference( + DeploymentResourceIdReference configurationGroupSchemaResourceReference) { + super.withConfigurationGroupSchemaResourceReference(configurationGroupSchemaResourceReference); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionDefinitionVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionDefinitionVersion.java new file mode 100644 index 000000000000..692b7f7106e8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionDefinitionVersion.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Containerized network function network function definition version properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "networkFunctionType") +@JsonTypeName("ContainerizedNetworkFunction") +@Fluent +public final class ContainerizedNetworkFunctionDefinitionVersion + extends NetworkFunctionDefinitionVersionPropertiesFormat { + /* + * Containerized network function template. + */ + @JsonProperty(value = "networkFunctionTemplate") + private ContainerizedNetworkFunctionTemplate networkFunctionTemplate; + + /** Creates an instance of ContainerizedNetworkFunctionDefinitionVersion class. */ + public ContainerizedNetworkFunctionDefinitionVersion() { + } + + /** + * Get the networkFunctionTemplate property: Containerized network function template. + * + * @return the networkFunctionTemplate value. + */ + public ContainerizedNetworkFunctionTemplate networkFunctionTemplate() { + return this.networkFunctionTemplate; + } + + /** + * Set the networkFunctionTemplate property: Containerized network function template. + * + * @param networkFunctionTemplate the networkFunctionTemplate value to set. + * @return the ContainerizedNetworkFunctionDefinitionVersion object itself. + */ + public ContainerizedNetworkFunctionDefinitionVersion withNetworkFunctionTemplate( + ContainerizedNetworkFunctionTemplate networkFunctionTemplate) { + this.networkFunctionTemplate = networkFunctionTemplate; + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerizedNetworkFunctionDefinitionVersion withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerizedNetworkFunctionDefinitionVersion withDeployParameters(String deployParameters) { + super.withDeployParameters(deployParameters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFunctionTemplate() != null) { + networkFunctionTemplate().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionNfviType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionNfviType.java new file mode 100644 index 000000000000..2b93d29a9c1e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionNfviType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The network function type. */ +public final class ContainerizedNetworkFunctionNfviType + extends ExpandableStringEnum { + /** Static value Unknown for ContainerizedNetworkFunctionNfviType. */ + public static final ContainerizedNetworkFunctionNfviType UNKNOWN = fromString("Unknown"); + + /** Static value AzureArcKubernetes for ContainerizedNetworkFunctionNfviType. */ + public static final ContainerizedNetworkFunctionNfviType AZURE_ARC_KUBERNETES = fromString("AzureArcKubernetes"); + + /** + * Creates a new instance of ContainerizedNetworkFunctionNfviType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerizedNetworkFunctionNfviType() { + } + + /** + * Creates or finds a ContainerizedNetworkFunctionNfviType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerizedNetworkFunctionNfviType. + */ + @JsonCreator + public static ContainerizedNetworkFunctionNfviType fromString(String name) { + return fromString(name, ContainerizedNetworkFunctionNfviType.class); + } + + /** + * Gets known ContainerizedNetworkFunctionNfviType values. + * + * @return known ContainerizedNetworkFunctionNfviType values. + */ + public static Collection values() { + return values(ContainerizedNetworkFunctionNfviType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionTemplate.java new file mode 100644 index 000000000000..a87265f8698c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ContainerizedNetworkFunctionTemplate.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.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Containerized network function template. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "nfviType", + defaultImpl = ContainerizedNetworkFunctionTemplate.class) +@JsonTypeName("ContainerizedNetworkFunctionTemplate") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureArcKubernetes", value = AzureArcKubernetesNetworkFunctionTemplate.class) +}) +@Immutable +public class ContainerizedNetworkFunctionTemplate { + /** Creates an instance of ContainerizedNetworkFunctionTemplate class. */ + public ContainerizedNetworkFunctionTemplate() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CredentialType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CredentialType.java new file mode 100644 index 000000000000..393bf876da7f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CredentialType.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The credential type. */ +public final class CredentialType extends ExpandableStringEnum { + /** Static value Unknown for CredentialType. */ + public static final CredentialType UNKNOWN = fromString("Unknown"); + + /** Static value AzureContainerRegistryScopedToken for CredentialType. */ + public static final CredentialType AZURE_CONTAINER_REGISTRY_SCOPED_TOKEN = + fromString("AzureContainerRegistryScopedToken"); + + /** Static value AzureStorageAccountToken for CredentialType. */ + public static final CredentialType AZURE_STORAGE_ACCOUNT_TOKEN = fromString("AzureStorageAccountToken"); + + /** + * Creates a new instance of CredentialType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CredentialType() { + } + + /** + * Creates or finds a CredentialType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CredentialType. + */ + @JsonCreator + public static CredentialType fromString(String name) { + return fromString(name, CredentialType.class); + } + + /** + * Gets known CredentialType values. + * + * @return known CredentialType values. + */ + public static Collection values() { + return values(CredentialType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.java deleted file mode 100644 index 57adde3d2a9d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/CustomProfile.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the custom settings for the virtual machine. */ -@Fluent -public final class CustomProfile { - /* - * Path for metadata configuration. - */ - @JsonProperty(value = "metadataConfigurationPath") - private String metadataConfigurationPath; - - /** Creates an instance of CustomProfile class. */ - public CustomProfile() { - } - - /** - * Get the metadataConfigurationPath property: Path for metadata configuration. - * - * @return the metadataConfigurationPath value. - */ - public String metadataConfigurationPath() { - return this.metadataConfigurationPath; - } - - /** - * Set the metadataConfigurationPath property: Path for metadata configuration. - * - * @param metadataConfigurationPath the metadataConfigurationPath value to set. - * @return the CustomProfile object itself. - */ - public CustomProfile withMetadataConfigurationPath(String metadataConfigurationPath) { - this.metadataConfigurationPath = metadataConfigurationPath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DaemonSet.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DaemonSet.java new file mode 100644 index 000000000000..9f9e7ff8b3da --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DaemonSet.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Helm DaemonSet status properties. */ +@Fluent +public final class DaemonSet { + /* + * The name of the daemonSet. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The namespace of the daemonSet. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Desired number of pods + */ + @JsonProperty(value = "desired") + private Integer desired; + + /* + * Current number of pods + */ + @JsonProperty(value = "current") + private Integer current; + + /* + * Number of Ready pods + */ + @JsonProperty(value = "ready") + private Integer ready; + + /* + * Number of upto date pods + */ + @JsonProperty(value = "upToDate") + private Integer upToDate; + + /* + * Number of available pods. + */ + @JsonProperty(value = "available") + private Integer available; + + /* + * Creation Time of daemonSet. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /** Creates an instance of DaemonSet class. */ + public DaemonSet() { + } + + /** + * Get the name property: The name of the daemonSet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the daemonSet. + * + * @param name the name value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the daemonSet. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the daemonSet. + * + * @param namespace the namespace value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the desired property: Desired number of pods. + * + * @return the desired value. + */ + public Integer desired() { + return this.desired; + } + + /** + * Set the desired property: Desired number of pods. + * + * @param desired the desired value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withDesired(Integer desired) { + this.desired = desired; + return this; + } + + /** + * Get the current property: Current number of pods. + * + * @return the current value. + */ + public Integer current() { + return this.current; + } + + /** + * Set the current property: Current number of pods. + * + * @param current the current value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withCurrent(Integer current) { + this.current = current; + return this; + } + + /** + * Get the ready property: Number of Ready pods. + * + * @return the ready value. + */ + public Integer ready() { + return this.ready; + } + + /** + * Set the ready property: Number of Ready pods. + * + * @param ready the ready value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withReady(Integer ready) { + this.ready = ready; + return this; + } + + /** + * Get the upToDate property: Number of upto date pods. + * + * @return the upToDate value. + */ + public Integer upToDate() { + return this.upToDate; + } + + /** + * Set the upToDate property: Number of upto date pods. + * + * @param upToDate the upToDate value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withUpToDate(Integer upToDate) { + this.upToDate = upToDate; + return this; + } + + /** + * Get the available property: Number of available pods. + * + * @return the available value. + */ + public Integer available() { + return this.available; + } + + /** + * Set the available property: Number of available pods. + * + * @param available the available value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withAvailable(Integer available) { + this.available = available; + return this; + } + + /** + * Get the creationTime property: Creation Time of daemonSet. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Creation Time of daemonSet. + * + * @param creationTime the creationTime value to set. + * @return the DaemonSet object itself. + */ + public DaemonSet withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.java deleted file mode 100644 index 2661bc0a378a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DataDisk.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies information about the operating system disk used by the virtual machine. <br><br> For more - * information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ -@Fluent -public final class DataDisk { - /* - * Specifies how the virtual machine should be created. - */ - @JsonProperty(value = "createOption") - private DiskCreateOptionTypes createOption; - - /* - * The name of data disk. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the size of an empty disk in gigabytes. This element can be used to overwrite the size of the disk in - * a virtual machine image. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /** Creates an instance of DataDisk class. */ - public DataDisk() { - } - - /** - * Get the createOption property: Specifies how the virtual machine should be created. - * - * @return the createOption value. - */ - public DiskCreateOptionTypes createOption() { - return this.createOption; - } - - /** - * Set the createOption property: Specifies how the virtual machine should be created. - * - * @param createOption the createOption value to set. - * @return the DataDisk object itself. - */ - public DataDisk withCreateOption(DiskCreateOptionTypes createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the name property: The name of data disk. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of data disk. - * - * @param name the name value to set. - * @return the DataDisk object itself. - */ - public DataDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of an empty disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of an empty disk in gigabytes. This element can be used to - * overwrite the size of the disk in a virtual machine image. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the DataDisk object itself. - */ - public DataDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DependsOnProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DependsOnProfile.java new file mode 100644 index 000000000000..42e6d721fc88 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DependsOnProfile.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Depends on profile definition. */ +@Fluent +public final class DependsOnProfile { + /* + * Application installation operation dependency. + */ + @JsonProperty(value = "installDependsOn") + private List installDependsOn; + + /* + * Application deletion operation dependency. + */ + @JsonProperty(value = "uninstallDependsOn") + private List uninstallDependsOn; + + /* + * Application update operation dependency. + */ + @JsonProperty(value = "updateDependsOn") + private List updateDependsOn; + + /** Creates an instance of DependsOnProfile class. */ + public DependsOnProfile() { + } + + /** + * Get the installDependsOn property: Application installation operation dependency. + * + * @return the installDependsOn value. + */ + public List installDependsOn() { + return this.installDependsOn; + } + + /** + * Set the installDependsOn property: Application installation operation dependency. + * + * @param installDependsOn the installDependsOn value to set. + * @return the DependsOnProfile object itself. + */ + public DependsOnProfile withInstallDependsOn(List installDependsOn) { + this.installDependsOn = installDependsOn; + return this; + } + + /** + * Get the uninstallDependsOn property: Application deletion operation dependency. + * + * @return the uninstallDependsOn value. + */ + public List uninstallDependsOn() { + return this.uninstallDependsOn; + } + + /** + * Set the uninstallDependsOn property: Application deletion operation dependency. + * + * @param uninstallDependsOn the uninstallDependsOn value to set. + * @return the DependsOnProfile object itself. + */ + public DependsOnProfile withUninstallDependsOn(List uninstallDependsOn) { + this.uninstallDependsOn = uninstallDependsOn; + return this; + } + + /** + * Get the updateDependsOn property: Application update operation dependency. + * + * @return the updateDependsOn value. + */ + public List updateDependsOn() { + return this.updateDependsOn; + } + + /** + * Set the updateDependsOn property: Application update operation dependency. + * + * @param updateDependsOn the updateDependsOn value to set. + * @return the DependsOnProfile object itself. + */ + public DependsOnProfile withUpdateDependsOn(List updateDependsOn) { + this.updateDependsOn = updateDependsOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Deployment.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Deployment.java new file mode 100644 index 000000000000..e8c0b8a356ad --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Deployment.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Helm Deployment status properties. */ +@Fluent +public final class Deployment { + /* + * The name of the deployment. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The namespace of the deployment. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Desired number of pods + */ + @JsonProperty(value = "desired") + private Integer desired; + + /* + * Number of ready pods. + */ + @JsonProperty(value = "ready") + private Integer ready; + + /* + * Number of upto date pods. + */ + @JsonProperty(value = "upToDate") + private Integer upToDate; + + /* + * Number of available pods. + */ + @JsonProperty(value = "available") + private Integer available; + + /* + * Creation Time of deployment. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /** Creates an instance of Deployment class. */ + public Deployment() { + } + + /** + * Get the name property: The name of the deployment. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the deployment. + * + * @param name the name value to set. + * @return the Deployment object itself. + */ + public Deployment withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the deployment. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the deployment. + * + * @param namespace the namespace value to set. + * @return the Deployment object itself. + */ + public Deployment withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the desired property: Desired number of pods. + * + * @return the desired value. + */ + public Integer desired() { + return this.desired; + } + + /** + * Set the desired property: Desired number of pods. + * + * @param desired the desired value to set. + * @return the Deployment object itself. + */ + public Deployment withDesired(Integer desired) { + this.desired = desired; + return this; + } + + /** + * Get the ready property: Number of ready pods. + * + * @return the ready value. + */ + public Integer ready() { + return this.ready; + } + + /** + * Set the ready property: Number of ready pods. + * + * @param ready the ready value to set. + * @return the Deployment object itself. + */ + public Deployment withReady(Integer ready) { + this.ready = ready; + return this; + } + + /** + * Get the upToDate property: Number of upto date pods. + * + * @return the upToDate value. + */ + public Integer upToDate() { + return this.upToDate; + } + + /** + * Set the upToDate property: Number of upto date pods. + * + * @param upToDate the upToDate value to set. + * @return the Deployment object itself. + */ + public Deployment withUpToDate(Integer upToDate) { + this.upToDate = upToDate; + return this; + } + + /** + * Get the available property: Number of available pods. + * + * @return the available value. + */ + public Integer available() { + return this.available; + } + + /** + * Set the available property: Number of available pods. + * + * @param available the available value to set. + * @return the Deployment object itself. + */ + public Deployment withAvailable(Integer available) { + this.available = available; + return this; + } + + /** + * Get the creationTime property: Creation Time of deployment. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Creation Time of deployment. + * + * @param creationTime the creationTime value to set. + * @return the Deployment object itself. + */ + public Deployment withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentResourceIdReference.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentResourceIdReference.java new file mode 100644 index 000000000000..01ee04a683a1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentResourceIdReference.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The azure resource reference which is used for deployment. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "idType", + defaultImpl = DeploymentResourceIdReference.class) +@JsonTypeName("DeploymentResourceIdReference") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Secret", value = SecretDeploymentResourceReference.class), + @JsonSubTypes.Type(name = "Open", value = OpenDeploymentResourceReference.class) +}) +@Immutable +public class DeploymentResourceIdReference { + /** Creates an instance of DeploymentResourceIdReference class. */ + public DeploymentResourceIdReference() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentStatusProperties.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentStatusProperties.java new file mode 100644 index 000000000000..5c68495f3cec --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeploymentStatusProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The deployment status properties of the network function component. */ +@Fluent +public final class DeploymentStatusProperties { + /* + * The status of the component resource. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The resource related to the component resource. + */ + @JsonProperty(value = "resources") + private Resources resources; + + /* + * The next expected update of deployment status. + */ + @JsonProperty(value = "nextExpectedUpdateAt") + private OffsetDateTime nextExpectedUpdateAt; + + /** Creates an instance of DeploymentStatusProperties class. */ + public DeploymentStatusProperties() { + } + + /** + * Get the status property: The status of the component resource. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the component resource. + * + * @param status the status value to set. + * @return the DeploymentStatusProperties object itself. + */ + public DeploymentStatusProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the resources property: The resource related to the component resource. + * + * @return the resources value. + */ + public Resources resources() { + return this.resources; + } + + /** + * Set the resources property: The resource related to the component resource. + * + * @param resources the resources value to set. + * @return the DeploymentStatusProperties object itself. + */ + public DeploymentStatusProperties withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the nextExpectedUpdateAt property: The next expected update of deployment status. + * + * @return the nextExpectedUpdateAt value. + */ + public OffsetDateTime nextExpectedUpdateAt() { + return this.nextExpectedUpdateAt; + } + + /** + * Set the nextExpectedUpdateAt property: The next expected update of deployment status. + * + * @param nextExpectedUpdateAt the nextExpectedUpdateAt value to set. + * @return the DeploymentStatusProperties object itself. + */ + public DeploymentStatusProperties withNextExpectedUpdateAt(OffsetDateTime nextExpectedUpdateAt) { + this.nextExpectedUpdateAt = nextExpectedUpdateAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resources() != null) { + resources().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DevicePropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DevicePropertiesFormat.java deleted file mode 100644 index 3d3c7d9356cd..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DevicePropertiesFormat.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SubResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Device properties. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "deviceType", - defaultImpl = DevicePropertiesFormat.class) -@JsonTypeName("DevicePropertiesFormat") -@JsonSubTypes({@JsonSubTypes.Type(name = "AzureStackEdge", value = AzureStackEdgeFormat.class)}) -@Immutable -public class DevicePropertiesFormat { - /* - * The current device status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; - - /* - * The provisioning state of the device resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The list of network functions deployed on the device. - */ - @JsonProperty(value = "networkFunctions", access = JsonProperty.Access.WRITE_ONLY) - private List networkFunctions; - - /** Creates an instance of DevicePropertiesFormat class. */ - public DevicePropertiesFormat() { - } - - /** - * Get the status property: The current device status. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Get the provisioningState property: The provisioning state of the device resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the networkFunctions property: The list of network functions deployed on the device. - * - * @return the networkFunctions value. - */ - public List networkFunctions() { - return this.networkFunctions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java deleted file mode 100644 index 383675fb129a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceRegistrationKey.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner; - -/** An immutable client-side representation of DeviceRegistrationKey. */ -public interface DeviceRegistrationKey { - /** - * Gets the registrationKey property: The registration key for the device. - * - * @return the registrationKey value. - */ - String registrationKey(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceRegistrationKeyInner object. - * - * @return the inner object. - */ - DeviceRegistrationKeyInner innerModel(); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.java deleted file mode 100644 index 2551bc83e8d6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the device. */ -public final class DeviceType extends ExpandableStringEnum { - /** Static value Unknown for DeviceType. */ - public static final DeviceType UNKNOWN = fromString("Unknown"); - - /** Static value AzureStackEdge for DeviceType. */ - public static final DeviceType AZURE_STACK_EDGE = fromString("AzureStackEdge"); - - /** - * Creates or finds a DeviceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeviceType. - */ - @JsonCreator - public static DeviceType fromString(String name) { - return fromString(name, DeviceType.class); - } - - /** - * Gets known DeviceType values. - * - * @return known DeviceType values. - */ - public static Collection values() { - return values(DeviceType.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.java deleted file mode 100644 index 9c7cccc24e5c..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DiskCreateOptionTypes.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Specifies how the virtual machine should be created. */ -public final class DiskCreateOptionTypes extends ExpandableStringEnum { - /** Static value Unknown for DiskCreateOptionTypes. */ - public static final DiskCreateOptionTypes UNKNOWN = fromString("Unknown"); - - /** Static value Empty for DiskCreateOptionTypes. */ - public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); - - /** - * Creates or finds a DiskCreateOptionTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding DiskCreateOptionTypes. - */ - @JsonCreator - public static DiskCreateOptionTypes fromString(String name) { - return fromString(name, DiskCreateOptionTypes.class); - } - - /** - * Gets known DiskCreateOptionTypes values. - * - * @return known DiskCreateOptionTypes values. - */ - public static Collection values() { - return values(DiskCreateOptionTypes.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ExecuteRequestParameters.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ExecuteRequestParameters.java new file mode 100644 index 000000000000..26dd094d32eb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ExecuteRequestParameters.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Payload for execute request post call. */ +@Fluent +public final class ExecuteRequestParameters { + /* + * The endpoint of service to call. + */ + @JsonProperty(value = "serviceEndpoint", required = true) + private String serviceEndpoint; + + /* + * The request metadata. + */ + @JsonProperty(value = "requestMetadata", required = true) + private RequestMetadata requestMetadata; + + /** Creates an instance of ExecuteRequestParameters class. */ + public ExecuteRequestParameters() { + } + + /** + * Get the serviceEndpoint property: The endpoint of service to call. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Set the serviceEndpoint property: The endpoint of service to call. + * + * @param serviceEndpoint the serviceEndpoint value to set. + * @return the ExecuteRequestParameters object itself. + */ + public ExecuteRequestParameters withServiceEndpoint(String serviceEndpoint) { + this.serviceEndpoint = serviceEndpoint; + return this; + } + + /** + * Get the requestMetadata property: The request metadata. + * + * @return the requestMetadata value. + */ + public RequestMetadata requestMetadata() { + return this.requestMetadata; + } + + /** + * Set the requestMetadata property: The request metadata. + * + * @param requestMetadata the requestMetadata value to set. + * @return the ExecuteRequestParameters object itself. + */ + public ExecuteRequestParameters withRequestMetadata(RequestMetadata requestMetadata) { + this.requestMetadata = requestMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceEndpoint() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceEndpoint in model ExecuteRequestParameters")); + } + if (requestMetadata() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property requestMetadata in model ExecuteRequestParameters")); + } else { + requestMetadata().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExecuteRequestParameters.class); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmArtifactProfile.java new file mode 100644 index 000000000000..c1be35e2afe6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmArtifactProfile.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Helm artifact profile. */ +@Fluent +public final class HelmArtifactProfile { + /* + * Helm package name. + */ + @JsonProperty(value = "helmPackageName") + private String helmPackageName; + + /* + * Helm package version range. + */ + @JsonProperty(value = "helmPackageVersionRange") + private String helmPackageVersionRange; + + /* + * The registry values path list. + */ + @JsonProperty(value = "registryValuesPaths") + private List registryValuesPaths; + + /* + * The image pull secrets values path list. + */ + @JsonProperty(value = "imagePullSecretsValuesPaths") + private List imagePullSecretsValuesPaths; + + /** Creates an instance of HelmArtifactProfile class. */ + public HelmArtifactProfile() { + } + + /** + * Get the helmPackageName property: Helm package name. + * + * @return the helmPackageName value. + */ + public String helmPackageName() { + return this.helmPackageName; + } + + /** + * Set the helmPackageName property: Helm package name. + * + * @param helmPackageName the helmPackageName value to set. + * @return the HelmArtifactProfile object itself. + */ + public HelmArtifactProfile withHelmPackageName(String helmPackageName) { + this.helmPackageName = helmPackageName; + return this; + } + + /** + * Get the helmPackageVersionRange property: Helm package version range. + * + * @return the helmPackageVersionRange value. + */ + public String helmPackageVersionRange() { + return this.helmPackageVersionRange; + } + + /** + * Set the helmPackageVersionRange property: Helm package version range. + * + * @param helmPackageVersionRange the helmPackageVersionRange value to set. + * @return the HelmArtifactProfile object itself. + */ + public HelmArtifactProfile withHelmPackageVersionRange(String helmPackageVersionRange) { + this.helmPackageVersionRange = helmPackageVersionRange; + return this; + } + + /** + * Get the registryValuesPaths property: The registry values path list. + * + * @return the registryValuesPaths value. + */ + public List registryValuesPaths() { + return this.registryValuesPaths; + } + + /** + * Set the registryValuesPaths property: The registry values path list. + * + * @param registryValuesPaths the registryValuesPaths value to set. + * @return the HelmArtifactProfile object itself. + */ + public HelmArtifactProfile withRegistryValuesPaths(List registryValuesPaths) { + this.registryValuesPaths = registryValuesPaths; + return this; + } + + /** + * Get the imagePullSecretsValuesPaths property: The image pull secrets values path list. + * + * @return the imagePullSecretsValuesPaths value. + */ + public List imagePullSecretsValuesPaths() { + return this.imagePullSecretsValuesPaths; + } + + /** + * Set the imagePullSecretsValuesPaths property: The image pull secrets values path list. + * + * @param imagePullSecretsValuesPaths the imagePullSecretsValuesPaths value to set. + * @return the HelmArtifactProfile object itself. + */ + public HelmArtifactProfile withImagePullSecretsValuesPaths(List imagePullSecretsValuesPaths) { + this.imagePullSecretsValuesPaths = imagePullSecretsValuesPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmInstallOptions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmInstallOptions.java new file mode 100644 index 000000000000..41829c41db2e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmInstallOptions.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The helm deployment install options. */ +@Fluent +public final class HelmInstallOptions { + /* + * The helm deployment atomic options + */ + @JsonProperty(value = "atomic") + private String atomic; + + /* + * The helm deployment wait options + */ + @JsonProperty(value = "wait") + private String wait; + + /* + * The helm deployment timeout options + */ + @JsonProperty(value = "timeout") + private String timeout; + + /** Creates an instance of HelmInstallOptions class. */ + public HelmInstallOptions() { + } + + /** + * Get the atomic property: The helm deployment atomic options. + * + * @return the atomic value. + */ + public String atomic() { + return this.atomic; + } + + /** + * Set the atomic property: The helm deployment atomic options. + * + * @param atomic the atomic value to set. + * @return the HelmInstallOptions object itself. + */ + public HelmInstallOptions withAtomic(String atomic) { + this.atomic = atomic; + return this; + } + + /** + * Get the wait property: The helm deployment wait options. + * + * @return the wait value. + */ + public String wait() { + return this.wait; + } + + /** + * Set the wait property: The helm deployment wait options. + * + * @param wait the wait value to set. + * @return the HelmInstallOptions object itself. + */ + public HelmInstallOptions withWait(String wait) { + this.wait = wait; + return this; + } + + /** + * Get the timeout property: The helm deployment timeout options. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The helm deployment timeout options. + * + * @param timeout the timeout value to set. + * @return the HelmInstallOptions object itself. + */ + public HelmInstallOptions withTimeout(String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfile.java new file mode 100644 index 000000000000..f3e096ad10e0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfile.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Helm mapping rule profile. */ +@Fluent +public final class HelmMappingRuleProfile { + /* + * Helm release namespace. + */ + @JsonProperty(value = "releaseNamespace") + private String releaseNamespace; + + /* + * Helm release name. + */ + @JsonProperty(value = "releaseName") + private String releaseName; + + /* + * Helm package version. + */ + @JsonProperty(value = "helmPackageVersion") + private String helmPackageVersion; + + /* + * Helm release values. + */ + @JsonProperty(value = "values") + private String values; + + /* + * The helm deployment options + */ + @JsonProperty(value = "options") + private HelmMappingRuleProfileOptions options; + + /** Creates an instance of HelmMappingRuleProfile class. */ + public HelmMappingRuleProfile() { + } + + /** + * Get the releaseNamespace property: Helm release namespace. + * + * @return the releaseNamespace value. + */ + public String releaseNamespace() { + return this.releaseNamespace; + } + + /** + * Set the releaseNamespace property: Helm release namespace. + * + * @param releaseNamespace the releaseNamespace value to set. + * @return the HelmMappingRuleProfile object itself. + */ + public HelmMappingRuleProfile withReleaseNamespace(String releaseNamespace) { + this.releaseNamespace = releaseNamespace; + return this; + } + + /** + * Get the releaseName property: Helm release name. + * + * @return the releaseName value. + */ + public String releaseName() { + return this.releaseName; + } + + /** + * Set the releaseName property: Helm release name. + * + * @param releaseName the releaseName value to set. + * @return the HelmMappingRuleProfile object itself. + */ + public HelmMappingRuleProfile withReleaseName(String releaseName) { + this.releaseName = releaseName; + return this; + } + + /** + * Get the helmPackageVersion property: Helm package version. + * + * @return the helmPackageVersion value. + */ + public String helmPackageVersion() { + return this.helmPackageVersion; + } + + /** + * Set the helmPackageVersion property: Helm package version. + * + * @param helmPackageVersion the helmPackageVersion value to set. + * @return the HelmMappingRuleProfile object itself. + */ + public HelmMappingRuleProfile withHelmPackageVersion(String helmPackageVersion) { + this.helmPackageVersion = helmPackageVersion; + return this; + } + + /** + * Get the values property: Helm release values. + * + * @return the values value. + */ + public String values() { + return this.values; + } + + /** + * Set the values property: Helm release values. + * + * @param values the values value to set. + * @return the HelmMappingRuleProfile object itself. + */ + public HelmMappingRuleProfile withValues(String values) { + this.values = values; + return this; + } + + /** + * Get the options property: The helm deployment options. + * + * @return the options value. + */ + public HelmMappingRuleProfileOptions options() { + return this.options; + } + + /** + * Set the options property: The helm deployment options. + * + * @param options the options value to set. + * @return the HelmMappingRuleProfile object itself. + */ + public HelmMappingRuleProfile withOptions(HelmMappingRuleProfileOptions options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (options() != null) { + options().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfileOptions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfileOptions.java new file mode 100644 index 000000000000..e5865adc8c44 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmMappingRuleProfileOptions.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The helm deployment options. */ +@Fluent +public final class HelmMappingRuleProfileOptions { + /* + * The helm deployment install options + */ + @JsonProperty(value = "installOptions") + private HelmInstallOptions installOptions; + + /* + * The helm deployment upgrade options + */ + @JsonProperty(value = "upgradeOptions") + private HelmUpgradeOptions upgradeOptions; + + /** Creates an instance of HelmMappingRuleProfileOptions class. */ + public HelmMappingRuleProfileOptions() { + } + + /** + * Get the installOptions property: The helm deployment install options. + * + * @return the installOptions value. + */ + public HelmInstallOptions installOptions() { + return this.installOptions; + } + + /** + * Set the installOptions property: The helm deployment install options. + * + * @param installOptions the installOptions value to set. + * @return the HelmMappingRuleProfileOptions object itself. + */ + public HelmMappingRuleProfileOptions withInstallOptions(HelmInstallOptions installOptions) { + this.installOptions = installOptions; + return this; + } + + /** + * Get the upgradeOptions property: The helm deployment upgrade options. + * + * @return the upgradeOptions value. + */ + public HelmUpgradeOptions upgradeOptions() { + return this.upgradeOptions; + } + + /** + * Set the upgradeOptions property: The helm deployment upgrade options. + * + * @param upgradeOptions the upgradeOptions value to set. + * @return the HelmMappingRuleProfileOptions object itself. + */ + public HelmMappingRuleProfileOptions withUpgradeOptions(HelmUpgradeOptions upgradeOptions) { + this.upgradeOptions = upgradeOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (installOptions() != null) { + installOptions().validate(); + } + if (upgradeOptions() != null) { + upgradeOptions().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmUpgradeOptions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmUpgradeOptions.java new file mode 100644 index 000000000000..c55aa0a7c192 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HelmUpgradeOptions.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The helm deployment install options. */ +@Fluent +public final class HelmUpgradeOptions { + /* + * The helm deployment atomic options + */ + @JsonProperty(value = "atomic") + private String atomic; + + /* + * The helm deployment wait options + */ + @JsonProperty(value = "wait") + private String wait; + + /* + * The helm deployment timeout options + */ + @JsonProperty(value = "timeout") + private String timeout; + + /** Creates an instance of HelmUpgradeOptions class. */ + public HelmUpgradeOptions() { + } + + /** + * Get the atomic property: The helm deployment atomic options. + * + * @return the atomic value. + */ + public String atomic() { + return this.atomic; + } + + /** + * Set the atomic property: The helm deployment atomic options. + * + * @param atomic the atomic value to set. + * @return the HelmUpgradeOptions object itself. + */ + public HelmUpgradeOptions withAtomic(String atomic) { + this.atomic = atomic; + return this; + } + + /** + * Get the wait property: The helm deployment wait options. + * + * @return the wait value. + */ + public String wait() { + return this.wait; + } + + /** + * Set the wait property: The helm deployment wait options. + * + * @param wait the wait value to set. + * @return the HelmUpgradeOptions object itself. + */ + public HelmUpgradeOptions withWait(String wait) { + this.wait = wait; + return this; + } + + /** + * Get the timeout property: The helm deployment timeout options. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The helm deployment timeout options. + * + * @param timeout the timeout value to set. + * @return the HelmUpgradeOptions object itself. + */ + public HelmUpgradeOptions withTimeout(String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HttpMethod.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HttpMethod.java new file mode 100644 index 000000000000..20d7ad99aac9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/HttpMethod.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The http method of the request. */ +public final class HttpMethod extends ExpandableStringEnum { + /** Static value Unknown for HttpMethod. */ + public static final HttpMethod UNKNOWN = fromString("Unknown"); + + /** Static value Post for HttpMethod. */ + public static final HttpMethod POST = fromString("Post"); + + /** Static value Put for HttpMethod. */ + public static final HttpMethod PUT = fromString("Put"); + + /** Static value Get for HttpMethod. */ + public static final HttpMethod GET = fromString("Get"); + + /** Static value Patch for HttpMethod. */ + public static final HttpMethod PATCH = fromString("Patch"); + + /** Static value Delete for HttpMethod. */ + public static final HttpMethod DELETE = fromString("Delete"); + + /** + * Creates a new instance of HttpMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpMethod() { + } + + /** + * Creates or finds a HttpMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpMethod. + */ + @JsonCreator + public static HttpMethod fromString(String name) { + return fromString(name, HttpMethod.class); + } + + /** + * Gets known HttpMethod values. + * + * @return known HttpMethod values. + */ + public static Collection values() { + return values(HttpMethod.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IdType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IdType.java new file mode 100644 index 000000000000..c5b6c13defb8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IdType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The resource reference arm id type. */ +public final class IdType extends ExpandableStringEnum { + /** Static value Unknown for IdType. */ + public static final IdType UNKNOWN = fromString("Unknown"); + + /** Static value Open for IdType. */ + public static final IdType OPEN = fromString("Open"); + + /** Static value Secret for IdType. */ + public static final IdType SECRET = fromString("Secret"); + + /** + * Creates a new instance of IdType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdType() { + } + + /** + * Creates or finds a IdType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdType. + */ + @JsonCreator + public static IdType fromString(String name) { + return fromString(name, IdType.class); + } + + /** + * Gets known IdType values. + * + * @return known IdType values. + */ + public static Collection values() { + return values(IdType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageArtifactProfile.java new file mode 100644 index 000000000000..ff2e1bdc8dba --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Image artifact profile. */ +@Fluent +public final class ImageArtifactProfile { + /* + * Image name. + */ + @JsonProperty(value = "imageName") + private String imageName; + + /* + * Image version. + */ + @JsonProperty(value = "imageVersion") + private String imageVersion; + + /** Creates an instance of ImageArtifactProfile class. */ + public ImageArtifactProfile() { + } + + /** + * Get the imageName property: Image name. + * + * @return the imageName value. + */ + public String imageName() { + return this.imageName; + } + + /** + * Set the imageName property: Image name. + * + * @param imageName the imageName value to set. + * @return the ImageArtifactProfile object itself. + */ + public ImageArtifactProfile withImageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * Get the imageVersion property: Image version. + * + * @return the imageVersion value. + */ + public String imageVersion() { + return this.imageVersion; + } + + /** + * Set the imageVersion property: Image version. + * + * @param imageVersion the imageVersion value to set. + * @return the ImageArtifactProfile object itself. + */ + public ImageArtifactProfile withImageVersion(String imageVersion) { + this.imageVersion = imageVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageMappingRuleProfile.java new file mode 100644 index 000000000000..5b96b140d1ff --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageMappingRuleProfile.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Image mapping rule profile. */ +@Fluent +public final class ImageMappingRuleProfile { + /* + * List of values. + */ + @JsonProperty(value = "userConfiguration") + private String userConfiguration; + + /** Creates an instance of ImageMappingRuleProfile class. */ + public ImageMappingRuleProfile() { + } + + /** + * Get the userConfiguration property: List of values. + * + * @return the userConfiguration value. + */ + public String userConfiguration() { + return this.userConfiguration; + } + + /** + * Set the userConfiguration property: List of values. + * + * @param userConfiguration the userConfiguration value to set. + * @return the ImageMappingRuleProfile object itself. + */ + public ImageMappingRuleProfile withUserConfiguration(String userConfiguration) { + this.userConfiguration = userConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.java deleted file mode 100644 index fab079e06dcd..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ImageReference.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The image reference properties. */ -@Fluent -public final class ImageReference { - /* - * The image publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the offer of the image used to create the virtual machine. - */ - @JsonProperty(value = "offer") - private String offer; - - /* - * The image SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * Specifies the version of the image used to create the virtual machine. The allowed formats are Major.Minor.Build - * or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image - * available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time - * even if a new version becomes available. - */ - @JsonProperty(value = "version") - private String version; - - /* - * Specifies in decimal numbers, the exact version of image used to create the virtual machine. - */ - @JsonProperty(value = "exactVersion") - private String exactVersion; - - /** Creates an instance of ImageReference class. */ - public ImageReference() { - } - - /** - * Get the publisher property: The image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The image publisher. - * - * @param publisher the publisher value to set. - * @return the ImageReference object itself. - */ - public ImageReference withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the offer property: Specifies the offer of the image used to create the virtual machine. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer property: Specifies the offer of the image used to create the virtual machine. - * - * @param offer the offer value to set. - * @return the ImageReference object itself. - */ - public ImageReference withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the sku property: The image SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The image SKU. - * - * @param sku the sku value to set. - * @return the ImageReference object itself. - */ - public ImageReference withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the version property: Specifies the version of the image used to create the virtual machine. The allowed - * formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use - * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not - * automatically update after deploy time even if a new version becomes available. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Specifies the version of the image used to create the virtual machine. The allowed - * formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use - * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not - * automatically update after deploy time even if a new version becomes available. - * - * @param version the version value to set. - * @return the ImageReference object itself. - */ - public ImageReference withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the exactVersion property: Specifies in decimal numbers, the exact version of image used to create the - * virtual machine. - * - * @return the exactVersion value. - */ - public String exactVersion() { - return this.exactVersion; - } - - /** - * Set the exactVersion property: Specifies in decimal numbers, the exact version of image used to create the - * virtual machine. - * - * @param exactVersion the exactVersion value to set. - * @return the ImageReference object itself. - */ - public ImageReference withExactVersion(String exactVersion) { - this.exactVersion = exactVersion; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.java deleted file mode 100644 index 2442598a9669..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpAllocationMethod.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** IP address allocation method. */ -public final class IpAllocationMethod extends ExpandableStringEnum { - /** Static value Unknown for IpAllocationMethod. */ - public static final IpAllocationMethod UNKNOWN = fromString("Unknown"); - - /** Static value Static for IpAllocationMethod. */ - public static final IpAllocationMethod STATIC = fromString("Static"); - - /** Static value Dynamic for IpAllocationMethod. */ - public static final IpAllocationMethod DYNAMIC = fromString("Dynamic"); - - /** - * Creates or finds a IpAllocationMethod from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpAllocationMethod. - */ - @JsonCreator - public static IpAllocationMethod fromString(String name) { - return fromString(name, IpAllocationMethod.class); - } - - /** - * Gets known IpAllocationMethod values. - * - * @return known IpAllocationMethod values. - */ - public static Collection values() { - return values(IpAllocationMethod.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.java deleted file mode 100644 index 015d882255f9..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/IpVersion.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** IP address version. */ -public final class IpVersion extends ExpandableStringEnum { - /** Static value Unknown for IpVersion. */ - public static final IpVersion UNKNOWN = fromString("Unknown"); - - /** Static value IPv4 for IpVersion. */ - public static final IpVersion IPV4 = fromString("IPv4"); - - /** - * Creates or finds a IpVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpVersion. - */ - @JsonCreator - public static IpVersion fromString(String name) { - return fromString(name, IpVersion.class); - } - - /** - * Gets known IpVersion values. - * - * @return known IpVersion values. - */ - public static Collection values() { - return values(IpVersion.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.java deleted file mode 100644 index 384ee47a61de..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/LinuxConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the Linux operating system settings on the virtual machine. */ -@Fluent -public final class LinuxConfiguration { - /* - * Specifies the ssh key configuration for a Linux OS. - */ - @JsonProperty(value = "ssh") - private SshConfiguration ssh; - - /** Creates an instance of LinuxConfiguration class. */ - public LinuxConfiguration() { - } - - /** - * Get the ssh property: Specifies the ssh key configuration for a Linux OS. - * - * @return the ssh value. - */ - public SshConfiguration ssh() { - return this.ssh; - } - - /** - * Set the ssh property: Specifies the ssh key configuration for a Linux OS. - * - * @param ssh the ssh value to set. - * @return the LinuxConfiguration object itself. - */ - public LinuxConfiguration withSsh(SshConfiguration ssh) { - this.ssh = ssh; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ssh() != null) { - ssh().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedResourceGroupConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..0761784b5f1c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedResourceGroupConfiguration.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed resource group configuration. */ +@Fluent +public final class ManagedResourceGroupConfiguration { + /* + * Managed resource group name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Managed resource group location. + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ManagedResourceGroupConfiguration class. */ + public ManagedResourceGroupConfiguration() { + } + + /** + * Get the name property: Managed resource group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Managed 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: Managed resource group location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Managed 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() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentity.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..8c53afed884b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + 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. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 + .logExceptionAsError( + 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); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentityType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..cfe29bb6b113 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManagedServiceIdentityType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManifestArtifactFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManifestArtifactFormat.java new file mode 100644 index 000000000000..cd01df2a9f18 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ManifestArtifactFormat.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Manifest artifact properties. */ +@Fluent +public final class ManifestArtifactFormat { + /* + * The artifact name + */ + @JsonProperty(value = "artifactName") + private String artifactName; + + /* + * The artifact type. + */ + @JsonProperty(value = "artifactType") + private ArtifactType artifactType; + + /* + * The artifact version. + */ + @JsonProperty(value = "artifactVersion") + private String artifactVersion; + + /** Creates an instance of ManifestArtifactFormat class. */ + public ManifestArtifactFormat() { + } + + /** + * Get the artifactName property: The artifact name. + * + * @return the artifactName value. + */ + public String artifactName() { + return this.artifactName; + } + + /** + * Set the artifactName property: The artifact name. + * + * @param artifactName the artifactName value to set. + * @return the ManifestArtifactFormat object itself. + */ + public ManifestArtifactFormat withArtifactName(String artifactName) { + this.artifactName = artifactName; + return this; + } + + /** + * Get the artifactType property: The artifact type. + * + * @return the artifactType value. + */ + public ArtifactType artifactType() { + return this.artifactType; + } + + /** + * Set the artifactType property: The artifact type. + * + * @param artifactType the artifactType value to set. + * @return the ManifestArtifactFormat object itself. + */ + public ManifestArtifactFormat withArtifactType(ArtifactType artifactType) { + this.artifactType = artifactType; + return this; + } + + /** + * Get the artifactVersion property: The artifact version. + * + * @return the artifactVersion value. + */ + public String artifactVersion() { + return this.artifactVersion; + } + + /** + * Set the artifactVersion property: The artifact version. + * + * @param artifactVersion the artifactVersion value to set. + * @return the ManifestArtifactFormat object itself. + */ + public ManifestArtifactFormat withArtifactVersion(String artifactVersion) { + this.artifactVersion = artifactVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/MappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/MappingRuleProfile.java new file mode 100644 index 000000000000..d7160b58d786 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/MappingRuleProfile.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Mapping rule profile properties. */ +@Fluent +public class MappingRuleProfile { + /* + * The application enablement. + */ + @JsonProperty(value = "applicationEnablement") + private ApplicationEnablement applicationEnablement; + + /** Creates an instance of MappingRuleProfile class. */ + public MappingRuleProfile() { + } + + /** + * Get the applicationEnablement property: The application enablement. + * + * @return the applicationEnablement value. + */ + public ApplicationEnablement applicationEnablement() { + return this.applicationEnablement; + } + + /** + * Set the applicationEnablement property: The application enablement. + * + * @param applicationEnablement the applicationEnablement value to set. + * @return the MappingRuleProfile object itself. + */ + public MappingRuleProfile withApplicationEnablement(ApplicationEnablement applicationEnablement) { + this.applicationEnablement = applicationEnablement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java index 4e17e3ea7345..d744bf77290e 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunction.java @@ -5,11 +5,9 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.management.Region; -import com.azure.core.management.SubResource; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner; -import java.util.List; import java.util.Map; /** An immutable client-side representation of NetworkFunction. */ @@ -50,96 +48,32 @@ public interface NetworkFunction { Map tags(); /** - * Gets the etag property: A unique read-only string that changes whenever the resource is updated. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the network function resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the device property: The reference to the device resource. Once set, it cannot be updated. - * - * @return the device value. - */ - SubResource device(); - - /** - * Gets the skuName property: The sku name for the network function. Once set, it cannot be updated. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the skuType property: The sku type for the network function. - * - * @return the skuType value. - */ - SkuType skuType(); - - /** - * Gets the vendorName property: The vendor name for the network function. Once set, it cannot be updated. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the serviceKey property: The service key for the network function resource. - * - * @return the serviceKey value. - */ - String serviceKey(); - - /** - * Gets the vendorProvisioningState property: The vendor provisioning state for the network function resource. - * - * @return the vendorProvisioningState value. - */ - VendorProvisioningState vendorProvisioningState(); - - /** - * Gets the managedApplication property: The resource URI of the managed application. + * Gets the properties property: Network function properties. * - * @return the managedApplication value. + * @return the properties value. */ - SubResource managedApplication(); + NetworkFunctionPropertiesFormat properties(); /** - * Gets the managedApplicationParameters property: The parameters for the managed application. + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. * - * @return the managedApplicationParameters value. + * @return the etag value. */ - Object managedApplicationParameters(); + String etag(); /** - * Gets the networkFunctionContainerConfigurations property: The network function container configurations from the - * user. + * Gets the identity property: The managed identity of the network function. * - * @return the networkFunctionContainerConfigurations value. + * @return the identity value. */ - Object networkFunctionContainerConfigurations(); + ManagedServiceIdentity identity(); /** - * Gets the networkFunctionUserConfigurations property: The network function configurations from the user. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the networkFunctionUserConfigurations value. + * @return the systemData value. */ - List networkFunctionUserConfigurations(); + SystemData systemData(); /** * Gets the region of the resource. @@ -176,11 +110,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The NetworkFunction definition stages. */ interface DefinitionStages { /** The first stage of the NetworkFunction definition. */ interface Blank extends WithLocation { } + /** The stage of the NetworkFunction definition allowing to specify location. */ interface WithLocation { /** @@ -199,6 +135,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the NetworkFunction definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -209,19 +146,16 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the NetworkFunction 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.WithEtag, - DefinitionStages.WithDevice, - DefinitionStages.WithSkuName, - DefinitionStages.WithVendorName, - DefinitionStages.WithManagedApplicationParameters, - DefinitionStages.WithNetworkFunctionContainerConfigurations, - DefinitionStages.WithNetworkFunctionUserConfigurations { + DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -237,6 +171,7 @@ interface WithCreate */ NetworkFunction create(Context context); } + /** The stage of the NetworkFunction definition allowing to specify tags. */ interface WithTags { /** @@ -247,82 +182,41 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the NetworkFunction definition allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: A unique read-only string that changes whenever the resource is updated.. - * - * @param etag A unique read-only string that changes whenever the resource is updated. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - /** The stage of the NetworkFunction definition allowing to specify device. */ - interface WithDevice { - /** - * Specifies the device property: The reference to the device resource. Once set, it cannot be updated.. - * - * @param device The reference to the device resource. Once set, it cannot be updated. - * @return the next definition stage. - */ - WithCreate withDevice(SubResource device); - } - /** The stage of the NetworkFunction definition allowing to specify skuName. */ - interface WithSkuName { - /** - * Specifies the skuName property: The sku name for the network function. Once set, it cannot be updated.. - * - * @param skuName The sku name for the network function. Once set, it cannot be updated. - * @return the next definition stage. - */ - WithCreate withSkuName(String skuName); - } - /** The stage of the NetworkFunction definition allowing to specify vendorName. */ - interface WithVendorName { - /** - * Specifies the vendorName property: The vendor name for the network function. Once set, it cannot be - * updated.. - * - * @param vendorName The vendor name for the network function. Once set, it cannot be updated. - * @return the next definition stage. - */ - WithCreate withVendorName(String vendorName); - } - /** The stage of the NetworkFunction definition allowing to specify managedApplicationParameters. */ - interface WithManagedApplicationParameters { + + /** The stage of the NetworkFunction definition allowing to specify properties. */ + interface WithProperties { /** - * Specifies the managedApplicationParameters property: The parameters for the managed application.. + * Specifies the properties property: Network function properties.. * - * @param managedApplicationParameters The parameters for the managed application. + * @param properties Network function properties. * @return the next definition stage. */ - WithCreate withManagedApplicationParameters(Object managedApplicationParameters); + WithCreate withProperties(NetworkFunctionPropertiesFormat properties); } - /** The stage of the NetworkFunction definition allowing to specify networkFunctionContainerConfigurations. */ - interface WithNetworkFunctionContainerConfigurations { + + /** The stage of the NetworkFunction definition allowing to specify etag. */ + interface WithEtag { /** - * Specifies the networkFunctionContainerConfigurations property: The network function container - * configurations from the user.. + * Specifies the etag property: A unique read-only string that changes whenever the resource is updated.. * - * @param networkFunctionContainerConfigurations The network function container configurations from the - * user. + * @param etag A unique read-only string that changes whenever the resource is updated. * @return the next definition stage. */ - WithCreate withNetworkFunctionContainerConfigurations(Object networkFunctionContainerConfigurations); + WithCreate withEtag(String etag); } - /** The stage of the NetworkFunction definition allowing to specify networkFunctionUserConfigurations. */ - interface WithNetworkFunctionUserConfigurations { + + /** The stage of the NetworkFunction definition allowing to specify identity. */ + interface WithIdentity { /** - * Specifies the networkFunctionUserConfigurations property: The network function configurations from the - * user.. + * Specifies the identity property: The managed identity of the network function.. * - * @param networkFunctionUserConfigurations The network function configurations from the user. + * @param identity The managed identity of the network function. * @return the next definition stage. */ - WithCreate withNetworkFunctionUserConfigurations( - List networkFunctionUserConfigurations); + WithCreate withIdentity(ManagedServiceIdentity identity); } } + /** * Begins update for the NetworkFunction resource. * @@ -347,6 +241,7 @@ interface Update extends UpdateStages.WithTags { */ NetworkFunction apply(Context context); } + /** The NetworkFunction update stages. */ interface UpdateStages { /** The stage of the NetworkFunction update allowing to specify tags. */ @@ -360,6 +255,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * @@ -374,4 +270,25 @@ interface WithTags { * @return the refreshed resource. */ NetworkFunction refresh(Context context); + + /** + * Execute a request to services on a containerized network function. + * + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest(ExecuteRequestParameters parameters); + + /** + * Execute a request to services on a containerized network function. + * + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest(ExecuteRequestParameters parameters, Context context); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionApplication.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionApplication.java new file mode 100644 index 000000000000..91c79a7b5535 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionApplication.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network function application definition. */ +@Fluent +public class NetworkFunctionApplication { + /* + * The name of the network function application. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Depends on profile definition. + */ + @JsonProperty(value = "dependsOnProfile") + private DependsOnProfile dependsOnProfile; + + /** Creates an instance of NetworkFunctionApplication class. */ + public NetworkFunctionApplication() { + } + + /** + * Get the name property: The name of the network function application. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the network function application. + * + * @param name the name value to set. + * @return the NetworkFunctionApplication object itself. + */ + public NetworkFunctionApplication withName(String name) { + this.name = name; + return this; + } + + /** + * Get the dependsOnProfile property: Depends on profile definition. + * + * @return the dependsOnProfile value. + */ + public DependsOnProfile dependsOnProfile() { + return this.dependsOnProfile; + } + + /** + * Set the dependsOnProfile property: Depends on profile definition. + * + * @param dependsOnProfile the dependsOnProfile value to set. + * @return the NetworkFunctionApplication object itself. + */ + public NetworkFunctionApplication withDependsOnProfile(DependsOnProfile dependsOnProfile) { + this.dependsOnProfile = dependsOnProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dependsOnProfile() != null) { + dependsOnProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionConfigurationType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionConfigurationType.java new file mode 100644 index 000000000000..65540e3092db --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionConfigurationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The secret type which indicates if secret or not. */ +public final class NetworkFunctionConfigurationType extends ExpandableStringEnum { + /** Static value Unknown for NetworkFunctionConfigurationType. */ + public static final NetworkFunctionConfigurationType UNKNOWN = fromString("Unknown"); + + /** Static value Secret for NetworkFunctionConfigurationType. */ + public static final NetworkFunctionConfigurationType SECRET = fromString("Secret"); + + /** Static value Open for NetworkFunctionConfigurationType. */ + public static final NetworkFunctionConfigurationType OPEN = fromString("Open"); + + /** + * Creates a new instance of NetworkFunctionConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkFunctionConfigurationType() { + } + + /** + * Creates or finds a NetworkFunctionConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFunctionConfigurationType. + */ + @JsonCreator + public static NetworkFunctionConfigurationType fromString(String name) { + return fromString(name, NetworkFunctionConfigurationType.class); + } + + /** + * Gets known NetworkFunctionConfigurationType values. + * + * @return known NetworkFunctionConfigurationType values. + */ + public static Collection values() { + return values(NetworkFunctionConfigurationType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroup.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroup.java new file mode 100644 index 000000000000..16ab9270e9c0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroup.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkFunctionDefinitionGroup. */ +public interface NetworkFunctionDefinitionGroup { + /** + * 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: Network function definition group properties. + * + * @return the properties value. + */ + NetworkFunctionDefinitionGroupPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner object. + * + * @return the inner object. + */ + NetworkFunctionDefinitionGroupInner innerModel(); + + /** The entirety of the NetworkFunctionDefinitionGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The NetworkFunctionDefinitionGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkFunctionDefinitionGroup definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the NetworkFunctionDefinitionGroup 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the NetworkFunctionDefinitionGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @return the next definition stage. + */ + WithCreate withExistingPublisher(String resourceGroupName, String publisherName); + } + + /** + * The stage of the NetworkFunctionDefinitionGroup 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFunctionDefinitionGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFunctionDefinitionGroup create(Context context); + } + + /** The stage of the NetworkFunctionDefinitionGroup 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 NetworkFunctionDefinitionGroup definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Network function definition group properties.. + * + * @param properties Network function definition group properties. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkFunctionDefinitionGroupPropertiesFormat properties); + } + } + + /** + * Begins update for the NetworkFunctionDefinitionGroup resource. + * + * @return the stage of resource update. + */ + NetworkFunctionDefinitionGroup.Update update(); + + /** The template for NetworkFunctionDefinitionGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFunctionDefinitionGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFunctionDefinitionGroup apply(Context context); + } + + /** The NetworkFunctionDefinitionGroup update stages. */ + interface UpdateStages { + /** The stage of the NetworkFunctionDefinitionGroup 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFunctionDefinitionGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFunctionDefinitionGroup refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupListResult.java new file mode 100644 index 000000000000..60ccd41874c6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of network function definition group resources. */ +@Fluent +public final class NetworkFunctionDefinitionGroupListResult { + /* + * A list of network function definition group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of NetworkFunctionDefinitionGroupListResult class. */ + public NetworkFunctionDefinitionGroupListResult() { + } + + /** + * Get the value property: A list of network function definition group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network function definition group. + * + * @param value the value value to set. + * @return the NetworkFunctionDefinitionGroupListResult object itself. + */ + public NetworkFunctionDefinitionGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupPropertiesFormat.java new file mode 100644 index 000000000000..8a6127ac952e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroupPropertiesFormat.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network function definition group properties. */ +@Fluent +public final class NetworkFunctionDefinitionGroupPropertiesFormat { + /* + * The provisioning state of the network function definition groups resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The network function definition group description. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of NetworkFunctionDefinitionGroupPropertiesFormat class. */ + public NetworkFunctionDefinitionGroupPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network function definition groups resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the description property: The network function definition group description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The network function definition group description. + * + * @param description the description value to set. + * @return the NetworkFunctionDefinitionGroupPropertiesFormat object itself. + */ + public NetworkFunctionDefinitionGroupPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroups.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroups.java new file mode 100644 index 000000000000..26873883a3b1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionGroups.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.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 NetworkFunctionDefinitionGroups. */ +public interface NetworkFunctionDefinitionGroups { + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String publisherName); + + /** + * Gets information of the network function definition groups under a publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network function definition groups under a publisher as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkFunctionDefinitionGroupName); + + /** + * Deletes a specified network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified networkFunctionDefinition group. + */ + NetworkFunctionDefinitionGroup get( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @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 information about the specified networkFunctionDefinition group along with {@link Response}. + */ + NetworkFunctionDefinitionGroup getById(String id); + + /** + * Gets information about the specified networkFunctionDefinition group. + * + * @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 information about the specified networkFunctionDefinition group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified network function definition group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified network function definition group. + * + * @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 NetworkFunctionDefinitionGroup resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFunctionDefinitionGroup definition. + */ + NetworkFunctionDefinitionGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionResourceElementTemplateDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionResourceElementTemplateDetails.java new file mode 100644 index 000000000000..cf4d08f9e358 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionResourceElementTemplateDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The network function definition resource element template details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("NetworkFunctionDefinition") +@Fluent +public final class NetworkFunctionDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + /* + * The resource element template type. + */ + @JsonProperty(value = "configuration") + private ArmResourceDefinitionResourceElementTemplate configuration; + + /** Creates an instance of NetworkFunctionDefinitionResourceElementTemplateDetails class. */ + public NetworkFunctionDefinitionResourceElementTemplateDetails() { + } + + /** + * Get the configuration property: The resource element template type. + * + * @return the configuration value. + */ + public ArmResourceDefinitionResourceElementTemplate configuration() { + return this.configuration; + } + + /** + * Set the configuration property: The resource element template type. + * + * @param configuration the configuration value to set. + * @return the NetworkFunctionDefinitionResourceElementTemplateDetails object itself. + */ + public NetworkFunctionDefinitionResourceElementTemplateDetails withConfiguration( + ArmResourceDefinitionResourceElementTemplate configuration) { + this.configuration = configuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionResourceElementTemplateDetails withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionDefinitionResourceElementTemplateDetails withDependsOnProfile( + DependsOnProfile dependsOnProfile) { + super.withDependsOnProfile(dependsOnProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersion.java new file mode 100644 index 000000000000..8695016388e8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersion.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkFunctionDefinitionVersion. */ +public interface NetworkFunctionDefinitionVersion { + /** + * 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: Network function definition version properties. + * + * @return the properties value. + */ + NetworkFunctionDefinitionVersionPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner + * object. + * + * @return the inner object. + */ + NetworkFunctionDefinitionVersionInner innerModel(); + + /** The entirety of the NetworkFunctionDefinitionVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The NetworkFunctionDefinitionVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkFunctionDefinitionVersion definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the NetworkFunctionDefinitionVersion 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the NetworkFunctionDefinitionVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName, networkFunctionDefinitionGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @return the next definition stage. + */ + WithCreate withExistingNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName); + } + + /** + * The stage of the NetworkFunctionDefinitionVersion 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFunctionDefinitionVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFunctionDefinitionVersion create(Context context); + } + + /** The stage of the NetworkFunctionDefinitionVersion 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 NetworkFunctionDefinitionVersion definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Network function definition version properties.. + * + * @param properties Network function definition version properties. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkFunctionDefinitionVersionPropertiesFormat properties); + } + } + + /** + * Begins update for the NetworkFunctionDefinitionVersion resource. + * + * @return the stage of resource update. + */ + NetworkFunctionDefinitionVersion.Update update(); + + /** The template for NetworkFunctionDefinitionVersion update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFunctionDefinitionVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFunctionDefinitionVersion apply(Context context); + } + + /** The NetworkFunctionDefinitionVersion update stages. */ + interface UpdateStages { + /** The stage of the NetworkFunctionDefinitionVersion 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFunctionDefinitionVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFunctionDefinitionVersion refresh(Context context); + + /** + * Update network function definition version state. + * + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + NetworkFunctionDefinitionVersionUpdateState updateState( + NetworkFunctionDefinitionVersionUpdateStateInner parameters); + + /** + * Update network function definition version state. + * + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + NetworkFunctionDefinitionVersionUpdateState updateState( + NetworkFunctionDefinitionVersionUpdateStateInner parameters, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionListResult.java new file mode 100644 index 000000000000..bcf4aa07604e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of network function definition versions. */ +@Fluent +public final class NetworkFunctionDefinitionVersionListResult { + /* + * A list of network function definition versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of NetworkFunctionDefinitionVersionListResult class. */ + public NetworkFunctionDefinitionVersionListResult() { + } + + /** + * Get the value property: A list of network function definition versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network function definition versions. + * + * @param value the value value to set. + * @return the NetworkFunctionDefinitionVersionListResult object itself. + */ + public NetworkFunctionDefinitionVersionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionPropertiesFormat.java new file mode 100644 index 000000000000..fbb79fab0602 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionPropertiesFormat.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Network function definition version properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "networkFunctionType", + defaultImpl = NetworkFunctionDefinitionVersionPropertiesFormat.class) +@JsonTypeName("NetworkFunctionDefinitionVersionPropertiesFormat") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "ContainerizedNetworkFunction", + value = ContainerizedNetworkFunctionDefinitionVersion.class), + @JsonSubTypes.Type(name = "VirtualNetworkFunction", value = VirtualNetworkFunctionDefinitionVersion.class) +}) +@Fluent +public class NetworkFunctionDefinitionVersionPropertiesFormat { + /* + * The provisioning state of the network function definition version resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The network function definition version state. + */ + @JsonProperty(value = "versionState", access = JsonProperty.Access.WRITE_ONLY) + private VersionState versionState; + + /* + * The network function definition version description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The deployment parameters of the network function definition version. + */ + @JsonProperty(value = "deployParameters") + private String deployParameters; + + /** Creates an instance of NetworkFunctionDefinitionVersionPropertiesFormat class. */ + public NetworkFunctionDefinitionVersionPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network function definition version resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the versionState property: The network function definition version state. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Get the description property: The network function definition version description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The network function definition version description. + * + * @param description the description value to set. + * @return the NetworkFunctionDefinitionVersionPropertiesFormat object itself. + */ + public NetworkFunctionDefinitionVersionPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the deployParameters property: The deployment parameters of the network function definition version. + * + * @return the deployParameters value. + */ + public String deployParameters() { + return this.deployParameters; + } + + /** + * Set the deployParameters property: The deployment parameters of the network function definition version. + * + * @param deployParameters the deployParameters value to set. + * @return the NetworkFunctionDefinitionVersionPropertiesFormat object itself. + */ + public NetworkFunctionDefinitionVersionPropertiesFormat withDeployParameters(String deployParameters) { + this.deployParameters = deployParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionUpdateState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionUpdateState.java new file mode 100644 index 000000000000..e7e11d0fc5d2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersionUpdateState.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.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; + +/** An immutable client-side representation of NetworkFunctionDefinitionVersionUpdateState. */ +public interface NetworkFunctionDefinitionVersionUpdateState { + /** + * Gets the versionState property: The network function definition version state. Only the 'Active' and 'Deprecated' + * states are allowed for updates. Other states are used for internal state transitioning. + * + * @return the versionState value. + */ + VersionState versionState(); + + /** + * Gets the inner + * com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner object. + * + * @return the inner object. + */ + NetworkFunctionDefinitionVersionUpdateStateInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersions.java new file mode 100644 index 000000000000..ccf71b3b84be --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionDefinitionVersions.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; + +/** Resource collection API of NetworkFunctionDefinitionVersions. */ +public interface NetworkFunctionDefinitionVersions { + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName); + + /** + * Deletes the specified network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context); + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + Context context); + + /** + * Gets information about a network function definition version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version. + */ + NetworkFunctionDefinitionVersion get( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName); + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName); + + /** + * Gets information about a list of network function definition versions under a network function definition group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network function definition versions under a network function definition + * group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkFunctionDefinitionGroup( + String resourceGroupName, String publisherName, String networkFunctionDefinitionGroupName, Context context); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + NetworkFunctionDefinitionVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters); + + /** + * Update network function definition version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkFunctionDefinitionGroupName The name of the network function definition group. + * @param networkFunctionDefinitionVersionName The name of the network function definition version. The name should + * conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network function definition version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network function definition version update request definition. + */ + NetworkFunctionDefinitionVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkFunctionDefinitionGroupName, + String networkFunctionDefinitionVersionName, + NetworkFunctionDefinitionVersionUpdateStateInner parameters, + Context context); + + /** + * Gets information about a network function definition version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response}. + */ + NetworkFunctionDefinitionVersion getById(String id); + + /** + * Gets information about a network function definition version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network function definition version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified network function definition version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network function definition version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkFunctionDefinitionVersion resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFunctionDefinitionVersion definition. + */ + NetworkFunctionDefinitionVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionPropertiesFormat.java new file mode 100644 index 000000000000..67a6a3c20676 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionPropertiesFormat.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network function properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "configurationType", + defaultImpl = NetworkFunctionPropertiesFormat.class) +@JsonTypeName("NetworkFunctionPropertiesFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Secret", value = NetworkFunctionValueWithSecrets.class), + @JsonSubTypes.Type(name = "Open", value = NetworkFunctionValueWithoutSecrets.class) +}) +@Fluent +public class NetworkFunctionPropertiesFormat { + /* + * The provisioning state of the network function resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The publisher name for the network function. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * The scope of the publisher. + */ + @JsonProperty(value = "publisherScope", access = JsonProperty.Access.WRITE_ONLY) + private PublisherScope publisherScope; + + /* + * The network function definition group name for the network function. + */ + @JsonProperty(value = "networkFunctionDefinitionGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String networkFunctionDefinitionGroupName; + + /* + * The network function definition version for the network function. + */ + @JsonProperty(value = "networkFunctionDefinitionVersion", access = JsonProperty.Access.WRITE_ONLY) + private String networkFunctionDefinitionVersion; + + /* + * The location of the network function definition offering. + */ + @JsonProperty(value = "networkFunctionDefinitionOfferingLocation", access = JsonProperty.Access.WRITE_ONLY) + private String networkFunctionDefinitionOfferingLocation; + + /* + * The network function definition version resource reference. + */ + @JsonProperty(value = "networkFunctionDefinitionVersionResourceReference") + private DeploymentResourceIdReference networkFunctionDefinitionVersionResourceReference; + + /* + * The nfvi type for the network function. + */ + @JsonProperty(value = "nfviType") + private NfviType nfviType; + + /* + * The nfviId for the network function. + */ + @JsonProperty(value = "nfviId") + private String nfviId; + + /* + * Indicates if software updates are allowed during deployment. + */ + @JsonProperty(value = "allowSoftwareUpdate") + private Boolean allowSoftwareUpdate; + + /* + * The role configuration override values from the user. + */ + @JsonProperty(value = "roleOverrideValues") + private List roleOverrideValues; + + /** Creates an instance of NetworkFunctionPropertiesFormat class. */ + public NetworkFunctionPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network function resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherName property: The publisher name for the network function. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the publisherScope property: The scope of the publisher. + * + * @return the publisherScope value. + */ + public PublisherScope publisherScope() { + return this.publisherScope; + } + + /** + * Get the networkFunctionDefinitionGroupName property: The network function definition group name for the network + * function. + * + * @return the networkFunctionDefinitionGroupName value. + */ + public String networkFunctionDefinitionGroupName() { + return this.networkFunctionDefinitionGroupName; + } + + /** + * Get the networkFunctionDefinitionVersion property: The network function definition version for the network + * function. + * + * @return the networkFunctionDefinitionVersion value. + */ + public String networkFunctionDefinitionVersion() { + return this.networkFunctionDefinitionVersion; + } + + /** + * Get the networkFunctionDefinitionOfferingLocation property: The location of the network function definition + * offering. + * + * @return the networkFunctionDefinitionOfferingLocation value. + */ + public String networkFunctionDefinitionOfferingLocation() { + return this.networkFunctionDefinitionOfferingLocation; + } + + /** + * Get the networkFunctionDefinitionVersionResourceReference property: The network function definition version + * resource reference. + * + * @return the networkFunctionDefinitionVersionResourceReference value. + */ + public DeploymentResourceIdReference networkFunctionDefinitionVersionResourceReference() { + return this.networkFunctionDefinitionVersionResourceReference; + } + + /** + * Set the networkFunctionDefinitionVersionResourceReference property: The network function definition version + * resource reference. + * + * @param networkFunctionDefinitionVersionResourceReference the networkFunctionDefinitionVersionResourceReference + * value to set. + * @return the NetworkFunctionPropertiesFormat object itself. + */ + public NetworkFunctionPropertiesFormat withNetworkFunctionDefinitionVersionResourceReference( + DeploymentResourceIdReference networkFunctionDefinitionVersionResourceReference) { + this.networkFunctionDefinitionVersionResourceReference = networkFunctionDefinitionVersionResourceReference; + return this; + } + + /** + * Get the nfviType property: The nfvi type for the network function. + * + * @return the nfviType value. + */ + public NfviType nfviType() { + return this.nfviType; + } + + /** + * Set the nfviType property: The nfvi type for the network function. + * + * @param nfviType the nfviType value to set. + * @return the NetworkFunctionPropertiesFormat object itself. + */ + public NetworkFunctionPropertiesFormat withNfviType(NfviType nfviType) { + this.nfviType = nfviType; + return this; + } + + /** + * Get the nfviId property: The nfviId for the network function. + * + * @return the nfviId value. + */ + public String nfviId() { + return this.nfviId; + } + + /** + * Set the nfviId property: The nfviId for the network function. + * + * @param nfviId the nfviId value to set. + * @return the NetworkFunctionPropertiesFormat object itself. + */ + public NetworkFunctionPropertiesFormat withNfviId(String nfviId) { + this.nfviId = nfviId; + return this; + } + + /** + * Get the allowSoftwareUpdate property: Indicates if software updates are allowed during deployment. + * + * @return the allowSoftwareUpdate value. + */ + public Boolean allowSoftwareUpdate() { + return this.allowSoftwareUpdate; + } + + /** + * Set the allowSoftwareUpdate property: Indicates if software updates are allowed during deployment. + * + * @param allowSoftwareUpdate the allowSoftwareUpdate value to set. + * @return the NetworkFunctionPropertiesFormat object itself. + */ + public NetworkFunctionPropertiesFormat withAllowSoftwareUpdate(Boolean allowSoftwareUpdate) { + this.allowSoftwareUpdate = allowSoftwareUpdate; + return this; + } + + /** + * Get the roleOverrideValues property: The role configuration override values from the user. + * + * @return the roleOverrideValues value. + */ + public List roleOverrideValues() { + return this.roleOverrideValues; + } + + /** + * Set the roleOverrideValues property: The role configuration override values from the user. + * + * @param roleOverrideValues the roleOverrideValues value to set. + * @return the NetworkFunctionPropertiesFormat object itself. + */ + public NetworkFunctionPropertiesFormat withRoleOverrideValues(List roleOverrideValues) { + this.roleOverrideValues = roleOverrideValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkFunctionDefinitionVersionResourceReference() != null) { + networkFunctionDefinitionVersionResourceReference().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java deleted file mode 100644 index 653ce01f46f4..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfiguration.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network function role configuration. */ -@Fluent -public final class NetworkFunctionRoleConfiguration { - /* - * The name of the network function role. - */ - @JsonProperty(value = "roleName") - private String roleName; - - /* - * Role type. - */ - @JsonProperty(value = "roleType") - private NetworkFunctionRoleConfigurationType roleType; - - /* - * The size of the virtual machine. - */ - @JsonProperty(value = "virtualMachineSize") - private VirtualMachineSizeTypes virtualMachineSize; - - /* - * Specifies the operating system settings for the role instance. This value can be updated during the deployment - * of network function. - */ - @JsonProperty(value = "osProfile") - private OsProfile osProfile; - - /* - * The user data template for customers. This is a json schema template describing the format and data type of user - * data parameters. - */ - @JsonProperty(value = "userDataTemplate") - private Object userDataTemplate; - - /* - * The user parameters for customers. The format of user data parameters has to be matched with the provided user - * data template. - */ - @JsonProperty(value = "userDataParameters") - private Object userDataParameters; - - /* - * The network interface configurations. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /* - * Specifies the storage settings for the virtual machine disks. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /* - * Specifies the custom settings for the virtual machine. - */ - @JsonProperty(value = "customProfile") - private CustomProfile customProfile; - - /** Creates an instance of NetworkFunctionRoleConfiguration class. */ - public NetworkFunctionRoleConfiguration() { - } - - /** - * Get the roleName property: The name of the network function role. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Set the roleName property: The name of the network function role. - * - * @param roleName the roleName value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withRoleName(String roleName) { - this.roleName = roleName; - return this; - } - - /** - * Get the roleType property: Role type. - * - * @return the roleType value. - */ - public NetworkFunctionRoleConfigurationType roleType() { - return this.roleType; - } - - /** - * Set the roleType property: Role type. - * - * @param roleType the roleType value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withRoleType(NetworkFunctionRoleConfigurationType roleType) { - this.roleType = roleType; - return this; - } - - /** - * Get the virtualMachineSize property: The size of the virtual machine. - * - * @return the virtualMachineSize value. - */ - public VirtualMachineSizeTypes virtualMachineSize() { - return this.virtualMachineSize; - } - - /** - * Set the virtualMachineSize property: The size of the virtual machine. - * - * @param virtualMachineSize the virtualMachineSize value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withVirtualMachineSize(VirtualMachineSizeTypes virtualMachineSize) { - this.virtualMachineSize = virtualMachineSize; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the role instance. This value can be - * updated during the deployment of network function. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the role instance. This value can be - * updated during the deployment of network function. - * - * @param osProfile the osProfile value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withOsProfile(OsProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the userDataTemplate property: The user data template for customers. This is a json schema template - * describing the format and data type of user data parameters. - * - * @return the userDataTemplate value. - */ - public Object userDataTemplate() { - return this.userDataTemplate; - } - - /** - * Set the userDataTemplate property: The user data template for customers. This is a json schema template - * describing the format and data type of user data parameters. - * - * @param userDataTemplate the userDataTemplate value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withUserDataTemplate(Object userDataTemplate) { - this.userDataTemplate = userDataTemplate; - return this; - } - - /** - * Get the userDataParameters property: The user parameters for customers. The format of user data parameters has to - * be matched with the provided user data template. - * - * @return the userDataParameters value. - */ - public Object userDataParameters() { - return this.userDataParameters; - } - - /** - * Set the userDataParameters property: The user parameters for customers. The format of user data parameters has to - * be matched with the provided user data template. - * - * @param userDataParameters the userDataParameters value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withUserDataParameters(Object userDataParameters) { - this.userDataParameters = userDataParameters; - return this; - } - - /** - * Get the networkInterfaces property: The network interface configurations. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: The network interface configurations. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. - * - * @param storageProfile the storageProfile value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the customProfile property: Specifies the custom settings for the virtual machine. - * - * @return the customProfile value. - */ - public CustomProfile customProfile() { - return this.customProfile; - } - - /** - * Set the customProfile property: Specifies the custom settings for the virtual machine. - * - * @param customProfile the customProfile value to set. - * @return the NetworkFunctionRoleConfiguration object itself. - */ - public NetworkFunctionRoleConfiguration withCustomProfile(CustomProfile customProfile) { - this.customProfile = customProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osProfile() != null) { - osProfile().validate(); - } - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (customProfile() != null) { - customProfile().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java deleted file mode 100644 index 15a4588f0148..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleConfigurationType.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Role type. */ -public final class NetworkFunctionRoleConfigurationType - extends ExpandableStringEnum { - /** Static value Unknown for NetworkFunctionRoleConfigurationType. */ - public static final NetworkFunctionRoleConfigurationType UNKNOWN = fromString("Unknown"); - - /** Static value VirtualMachine for NetworkFunctionRoleConfigurationType. */ - public static final NetworkFunctionRoleConfigurationType VIRTUAL_MACHINE = fromString("VirtualMachine"); - - /** - * Creates or finds a NetworkFunctionRoleConfigurationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkFunctionRoleConfigurationType. - */ - @JsonCreator - public static NetworkFunctionRoleConfigurationType fromString(String name) { - return fromString(name, NetworkFunctionRoleConfigurationType.class); - } - - /** - * Gets known NetworkFunctionRoleConfigurationType values. - * - * @return known NetworkFunctionRoleConfigurationType values. - */ - public static Collection values() { - return values(NetworkFunctionRoleConfigurationType.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.java deleted file mode 100644 index 8c19831afa42..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionRoleInstanceListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of role instances of vendor network function. */ -@Immutable -public final class NetworkFunctionRoleInstanceListResult { - /* - * A list of role instances. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of NetworkFunctionRoleInstanceListResult class. */ - public NetworkFunctionRoleInstanceListResult() { - } - - /** - * Get the value property: A list of role instances. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @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()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java deleted file mode 100644 index 9bbb3e49643a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuDetails.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network function sku details. */ -@Fluent -public final class NetworkFunctionSkuDetails { - /* - * The network function sku type. - */ - @JsonProperty(value = "skuType") - private SkuType skuType; - - /* - * The network function sku role details. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of NetworkFunctionSkuDetails class. */ - public NetworkFunctionSkuDetails() { - } - - /** - * Get the skuType property: The network function sku type. - * - * @return the skuType value. - */ - public SkuType skuType() { - return this.skuType; - } - - /** - * Set the skuType property: The network function sku type. - * - * @param skuType the skuType value to set. - * @return the NetworkFunctionSkuDetails object itself. - */ - public NetworkFunctionSkuDetails withSkuType(SkuType skuType) { - this.skuType = skuType; - return this; - } - - /** - * Get the value property: The network function sku role details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The network function sku role details. - * - * @param value the value value to set. - * @return the NetworkFunctionSkuDetails object itself. - */ - public NetworkFunctionSkuDetails withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @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()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.java deleted file mode 100644 index a7cf2fa73365..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionSkuRoleDetails.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import java.util.List; - -/** An immutable client-side representation of NetworkFunctionSkuRoleDetails. */ -public interface NetworkFunctionSkuRoleDetails { - /** - * Gets the roleName property: The name of the network function role. - * - * @return the roleName value. - */ - String roleName(); - - /** - * Gets the userDataTemplate property: The user data template for customers. - * - * @return the userDataTemplate value. - */ - Object userDataTemplate(); - - /** - * Gets the userDataParameters property: The user parameters for customers. - * - * @return the userDataParameters value. - */ - Object userDataParameters(); - - /** - * Gets the networkInterfaces property: The network interface configuration. - * - * @return the networkInterfaces value. - */ - List networkInterfaces(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner object. - * - * @return the inner object. - */ - NetworkFunctionSkuRoleDetailsInner innerModel(); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.java deleted file mode 100644 index beac21070432..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionTemplate.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The network function template. */ -@Fluent -public final class NetworkFunctionTemplate { - /* - * An array of network function role definitions. - */ - @JsonProperty(value = "networkFunctionRoleConfigurations") - private List networkFunctionRoleConfigurations; - - /** Creates an instance of NetworkFunctionTemplate class. */ - public NetworkFunctionTemplate() { - } - - /** - * Get the networkFunctionRoleConfigurations property: An array of network function role definitions. - * - * @return the networkFunctionRoleConfigurations value. - */ - public List networkFunctionRoleConfigurations() { - return this.networkFunctionRoleConfigurations; - } - - /** - * Set the networkFunctionRoleConfigurations property: An array of network function role definitions. - * - * @param networkFunctionRoleConfigurations the networkFunctionRoleConfigurations value to set. - * @return the NetworkFunctionTemplate object itself. - */ - public NetworkFunctionTemplate withNetworkFunctionRoleConfigurations( - List networkFunctionRoleConfigurations) { - this.networkFunctionRoleConfigurations = networkFunctionRoleConfigurations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkFunctionRoleConfigurations() != null) { - networkFunctionRoleConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java index 931d2a4a79a4..4d30bb8bf899 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionType.java @@ -19,6 +19,15 @@ public final class NetworkFunctionType extends ExpandableStringEnum networkInterfaces; - - /* - * Specifies the operating system settings for the role instance. - */ - @JsonProperty(value = "osProfile") - private NetworkFunctionUserConfigurationOsProfile osProfile; - - /** Creates an instance of NetworkFunctionUserConfiguration class. */ - public NetworkFunctionUserConfiguration() { - } - - /** - * Get the roleName property: The name of the network function role. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Set the roleName property: The name of the network function role. - * - * @param roleName the roleName value to set. - * @return the NetworkFunctionUserConfiguration object itself. - */ - public NetworkFunctionUserConfiguration withRoleName(String roleName) { - this.roleName = roleName; - return this; - } - - /** - * Get the userDataParameters property: The user data parameters from the customer. - * - * @return the userDataParameters value. - */ - public Object userDataParameters() { - return this.userDataParameters; - } - - /** - * Set the userDataParameters property: The user data parameters from the customer. - * - * @param userDataParameters the userDataParameters value to set. - * @return the NetworkFunctionUserConfiguration object itself. - */ - public NetworkFunctionUserConfiguration withUserDataParameters(Object userDataParameters) { - this.userDataParameters = userDataParameters; - return this; - } - - /** - * Get the networkInterfaces property: The network interface configuration. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: The network interface configuration. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkFunctionUserConfiguration object itself. - */ - public NetworkFunctionUserConfiguration withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the role instance. - * - * @return the osProfile value. - */ - public NetworkFunctionUserConfigurationOsProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the role instance. - * - * @param osProfile the osProfile value to set. - * @return the NetworkFunctionUserConfiguration object itself. - */ - public NetworkFunctionUserConfiguration withOsProfile(NetworkFunctionUserConfigurationOsProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - if (osProfile() != null) { - osProfile().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java deleted file mode 100644 index 833ce2216203..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionUserConfigurationOsProfile.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the operating system settings for the role instance. */ -@Fluent -public final class NetworkFunctionUserConfigurationOsProfile { - /* - * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that - * is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.

- * **Note: Do not pass any secrets or passwords in customData property**

This property cannot be updated - * after the VM is created.

customData is passed to the VM to be saved as a file. For more information see - * [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) - *

For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "customData") - private String customData; - - /** Creates an instance of NetworkFunctionUserConfigurationOsProfile class. */ - public NetworkFunctionUserConfigurationOsProfile() { - } - - /** - * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file. For more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the customData value. - */ - public String customData() { - return this.customData; - } - - /** - * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file. For more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param customData the customData value to set. - * @return the NetworkFunctionUserConfigurationOsProfile object itself. - */ - public NetworkFunctionUserConfigurationOsProfile withCustomData(String customData) { - this.customData = customData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithSecrets.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithSecrets.java new file mode 100644 index 000000000000..496905f1f78f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithSecrets.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NetworkFunction with secrets. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Secret") +@Fluent +public final class NetworkFunctionValueWithSecrets extends NetworkFunctionPropertiesFormat { + /* + * The JSON-serialized secret deployment values from the user. This contains secrets like passwords,keys etc + */ + @JsonProperty(value = "secretDeploymentValues") + private String secretDeploymentValues; + + /** Creates an instance of NetworkFunctionValueWithSecrets class. */ + public NetworkFunctionValueWithSecrets() { + } + + /** + * Get the secretDeploymentValues property: The JSON-serialized secret deployment values from the user. This + * contains secrets like passwords,keys etc. + * + * @return the secretDeploymentValues value. + */ + public String secretDeploymentValues() { + return this.secretDeploymentValues; + } + + /** + * Set the secretDeploymentValues property: The JSON-serialized secret deployment values from the user. This + * contains secrets like passwords,keys etc. + * + * @param secretDeploymentValues the secretDeploymentValues value to set. + * @return the NetworkFunctionValueWithSecrets object itself. + */ + public NetworkFunctionValueWithSecrets withSecretDeploymentValues(String secretDeploymentValues) { + this.secretDeploymentValues = secretDeploymentValues; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithSecrets withNetworkFunctionDefinitionVersionResourceReference( + DeploymentResourceIdReference networkFunctionDefinitionVersionResourceReference) { + super.withNetworkFunctionDefinitionVersionResourceReference(networkFunctionDefinitionVersionResourceReference); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithSecrets withNfviType(NfviType nfviType) { + super.withNfviType(nfviType); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithSecrets withNfviId(String nfviId) { + super.withNfviId(nfviId); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithSecrets withAllowSoftwareUpdate(Boolean allowSoftwareUpdate) { + super.withAllowSoftwareUpdate(allowSoftwareUpdate); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithSecrets withRoleOverrideValues(List roleOverrideValues) { + super.withRoleOverrideValues(roleOverrideValues); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithoutSecrets.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithoutSecrets.java new file mode 100644 index 000000000000..03888ced19d2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionValueWithoutSecrets.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NetworkFunction with no secrets. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Open") +@Fluent +public final class NetworkFunctionValueWithoutSecrets extends NetworkFunctionPropertiesFormat { + /* + * The JSON-serialized deployment values from the user. + */ + @JsonProperty(value = "deploymentValues") + private String deploymentValues; + + /** Creates an instance of NetworkFunctionValueWithoutSecrets class. */ + public NetworkFunctionValueWithoutSecrets() { + } + + /** + * Get the deploymentValues property: The JSON-serialized deployment values from the user. + * + * @return the deploymentValues value. + */ + public String deploymentValues() { + return this.deploymentValues; + } + + /** + * Set the deploymentValues property: The JSON-serialized deployment values from the user. + * + * @param deploymentValues the deploymentValues value to set. + * @return the NetworkFunctionValueWithoutSecrets object itself. + */ + public NetworkFunctionValueWithoutSecrets withDeploymentValues(String deploymentValues) { + this.deploymentValues = deploymentValues; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithoutSecrets withNetworkFunctionDefinitionVersionResourceReference( + DeploymentResourceIdReference networkFunctionDefinitionVersionResourceReference) { + super.withNetworkFunctionDefinitionVersionResourceReference(networkFunctionDefinitionVersionResourceReference); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithoutSecrets withNfviType(NfviType nfviType) { + super.withNfviType(nfviType); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithoutSecrets withNfviId(String nfviId) { + super.withNfviId(nfviId); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithoutSecrets withAllowSoftwareUpdate(Boolean allowSoftwareUpdate) { + super.withAllowSoftwareUpdate(allowSoftwareUpdate); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFunctionValueWithoutSecrets withRoleOverrideValues(List roleOverrideValues) { + super.withRoleOverrideValues(roleOverrideValues); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.java deleted file mode 100644 index 85fd4a8cb75d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendor.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import java.util.List; - -/** An immutable client-side representation of NetworkFunctionVendor. */ -public interface NetworkFunctionVendor { - /** - * Gets the vendorName property: The network function vendor name. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the skuList property: The network function sku list. - * - * @return the skuList value. - */ - List skuList(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner object. - * - * @return the inner object. - */ - NetworkFunctionVendorInner innerModel(); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java deleted file mode 100644 index 0a4211ce39df..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorConfiguration.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network function vendor configuration. */ -@Fluent -public final class NetworkFunctionVendorConfiguration { - /* - * The name of the vendor network function role. - */ - @JsonProperty(value = "roleName") - private String roleName; - - /* - * Specifies the operating system settings for the role instance. - */ - @JsonProperty(value = "osProfile") - private OsProfile osProfile; - - /* - * The user parameters from the customer. - */ - @JsonProperty(value = "userDataParameters", access = JsonProperty.Access.WRITE_ONLY) - private Object userDataParameters; - - /* - * The network interface configurations. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /** Creates an instance of NetworkFunctionVendorConfiguration class. */ - public NetworkFunctionVendorConfiguration() { - } - - /** - * Get the roleName property: The name of the vendor network function role. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Set the roleName property: The name of the vendor network function role. - * - * @param roleName the roleName value to set. - * @return the NetworkFunctionVendorConfiguration object itself. - */ - public NetworkFunctionVendorConfiguration withRoleName(String roleName) { - this.roleName = roleName; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the role instance. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the role instance. - * - * @param osProfile the osProfile value to set. - * @return the NetworkFunctionVendorConfiguration object itself. - */ - public NetworkFunctionVendorConfiguration withOsProfile(OsProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the userDataParameters property: The user parameters from the customer. - * - * @return the userDataParameters value. - */ - public Object userDataParameters() { - return this.userDataParameters; - } - - /** - * Get the networkInterfaces property: The network interface configurations. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: The network interface configurations. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkFunctionVendorConfiguration object itself. - */ - public NetworkFunctionVendorConfiguration withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osProfile() != null) { - osProfile().validate(); - } - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.java deleted file mode 100644 index 4c8c3bbb8687..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorSkus.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of NetworkFunctionVendorSkus. */ -public interface NetworkFunctionVendorSkus { - /** - * Lists all network function vendor sku details in a vendor. - * - * @param vendorName The name of the network function vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. - */ - PagedIterable listByVendor(String vendorName); - - /** - * Lists all network function vendor sku details in a vendor. - * - * @param vendorName The name of the network function vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 available network function skus as paginated response with {@link PagedIterable}. - */ - PagedIterable listByVendor(String vendorName, Context context); - - /** - * Lists information about network function vendor sku details. - * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySku(String vendorName, String vendorSkuName); - - /** - * Lists information about network function vendor sku details. - * - * @param vendorName The name of the network function vendor. - * @param vendorSkuName The name of the network function sku. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function sku details as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySku(String vendorName, String vendorSkuName, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java deleted file mode 100644 index 44d0633d112f..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendors.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of NetworkFunctionVendors. */ -public interface NetworkFunctionVendors { - /** - * Lists all the available vendor and sku information. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the available vendor and sku information. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the network function vendor list result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java index df87a0916787..9e8e4a7123ce 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctions.java @@ -11,8 +11,7 @@ /** Resource collection API of NetworkFunctions. */ public interface NetworkFunctions { /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -23,8 +22,7 @@ public interface NetworkFunctions { void deleteByResourceGroup(String resourceGroupName, String networkFunctionName); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkFunctionName The name of the network function. @@ -104,6 +102,32 @@ Response getByResourceGroupWithResponse( */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest(String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters); + + /** + * Execute a request to services on a containerized network function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFunctionName The name of the network function. + * @param parameters Payload for execute request post call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 executeRequest( + String resourceGroupName, String networkFunctionName, ExecuteRequestParameters parameters, Context context); + /** * Gets information about the specified network function resource. * @@ -128,8 +152,7 @@ Response getByResourceGroupWithResponse( Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -139,8 +162,7 @@ Response getByResourceGroupWithResponse( void deleteById(String id); /** - * Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is - * expected service behavior. + * Deletes the specified network function resource. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.java deleted file mode 100644 index fa603ff72b4c..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterface.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface properties. */ -@Fluent -public final class NetworkInterface { - /* - * The name of the network interface. - */ - @JsonProperty(value = "networkInterfaceName") - private String networkInterfaceName; - - /* - * The MAC address of the network interface. - */ - @JsonProperty(value = "macAddress") - private String macAddress; - - /* - * A list of IP configurations of the network interface. - */ - @JsonProperty(value = "ipConfigurations") - private List ipConfigurations; - - /* - * The type of the VM switch. - */ - @JsonProperty(value = "vmSwitchType") - private VMSwitchType vmSwitchType; - - /** Creates an instance of NetworkInterface class. */ - public NetworkInterface() { - } - - /** - * Get the networkInterfaceName property: The name of the network interface. - * - * @return the networkInterfaceName value. - */ - public String networkInterfaceName() { - return this.networkInterfaceName; - } - - /** - * Set the networkInterfaceName property: The name of the network interface. - * - * @param networkInterfaceName the networkInterfaceName value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withNetworkInterfaceName(String networkInterfaceName) { - this.networkInterfaceName = networkInterfaceName; - return this; - } - - /** - * Get the macAddress property: The MAC address of the network interface. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: The MAC address of the network interface. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the ipConfigurations property: A list of IP configurations of the network interface. - * - * @return the ipConfigurations value. - */ - public List ipConfigurations() { - return this.ipConfigurations; - } - - /** - * Set the ipConfigurations property: A list of IP configurations of the network interface. - * - * @param ipConfigurations the ipConfigurations value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withIpConfigurations(List ipConfigurations) { - this.ipConfigurations = ipConfigurations; - return this; - } - - /** - * Get the vmSwitchType property: The type of the VM switch. - * - * @return the vmSwitchType value. - */ - public VMSwitchType vmSwitchType() { - return this.vmSwitchType; - } - - /** - * Set the vmSwitchType property: The type of the VM switch. - * - * @param vmSwitchType the vmSwitchType value to set. - * @return the NetworkInterface object itself. - */ - public NetworkInterface withVmSwitchType(VMSwitchType vmSwitchType) { - this.vmSwitchType = vmSwitchType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipConfigurations() != null) { - ipConfigurations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java deleted file mode 100644 index afeb8b4d1a10..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkInterfaceIpConfiguration.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Network interface IP configuration properties. */ -@Fluent -public final class NetworkInterfaceIpConfiguration { - /* - * IP address allocation method. - */ - @JsonProperty(value = "ipAllocationMethod") - private IpAllocationMethod ipAllocationMethod; - - /* - * The value of the IP address. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /* - * The value of the subnet. - */ - @JsonProperty(value = "subnet") - private String subnet; - - /* - * The value of the gateway. - */ - @JsonProperty(value = "gateway") - private String gateway; - - /* - * IP address version. - */ - @JsonProperty(value = "ipVersion") - private IpVersion ipVersion; - - /* - * The list of DNS servers IP addresses. - */ - @JsonProperty(value = "dnsServers") - private List dnsServers; - - /** Creates an instance of NetworkInterfaceIpConfiguration class. */ - public NetworkInterfaceIpConfiguration() { - } - - /** - * Get the ipAllocationMethod property: IP address allocation method. - * - * @return the ipAllocationMethod value. - */ - public IpAllocationMethod ipAllocationMethod() { - return this.ipAllocationMethod; - } - - /** - * Set the ipAllocationMethod property: IP address allocation method. - * - * @param ipAllocationMethod the ipAllocationMethod value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withIpAllocationMethod(IpAllocationMethod ipAllocationMethod) { - this.ipAllocationMethod = ipAllocationMethod; - return this; - } - - /** - * Get the ipAddress property: The value of the IP address. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: The value of the IP address. - * - * @param ipAddress the ipAddress value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Get the subnet property: The value of the subnet. - * - * @return the subnet value. - */ - public String subnet() { - return this.subnet; - } - - /** - * Set the subnet property: The value of the subnet. - * - * @param subnet the subnet value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withSubnet(String subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the gateway property: The value of the gateway. - * - * @return the gateway value. - */ - public String gateway() { - return this.gateway; - } - - /** - * Set the gateway property: The value of the gateway. - * - * @param gateway the gateway value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withGateway(String gateway) { - this.gateway = gateway; - return this; - } - - /** - * Get the ipVersion property: IP address version. - * - * @return the ipVersion value. - */ - public IpVersion ipVersion() { - return this.ipVersion; - } - - /** - * Set the ipVersion property: IP address version. - * - * @param ipVersion the ipVersion value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withIpVersion(IpVersion ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * Get the dnsServers property: The list of DNS servers IP addresses. - * - * @return the dnsServers value. - */ - public List dnsServers() { - return this.dnsServers; - } - - /** - * Set the dnsServers property: The list of DNS servers IP addresses. - * - * @param dnsServers the dnsServers value to set. - * @return the NetworkInterfaceIpConfiguration object itself. - */ - public NetworkInterfaceIpConfiguration withDnsServers(List dnsServers) { - this.dnsServers = dnsServers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroup.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroup.java new file mode 100644 index 000000000000..2315a8d4b2cb --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroup.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkServiceDesignGroup. */ +public interface NetworkServiceDesignGroup { + /** + * 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: network service design group properties. + * + * @return the properties value. + */ + NetworkServiceDesignGroupPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner object. + * + * @return the inner object. + */ + NetworkServiceDesignGroupInner innerModel(); + + /** The entirety of the NetworkServiceDesignGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The NetworkServiceDesignGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkServiceDesignGroup definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the NetworkServiceDesignGroup 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the NetworkServiceDesignGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @return the next definition stage. + */ + WithCreate withExistingPublisher(String resourceGroupName, String publisherName); + } + + /** + * The stage of the NetworkServiceDesignGroup 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkServiceDesignGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkServiceDesignGroup create(Context context); + } + + /** The stage of the NetworkServiceDesignGroup 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 NetworkServiceDesignGroup definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: network service design group properties.. + * + * @param properties network service design group properties. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkServiceDesignGroupPropertiesFormat properties); + } + } + + /** + * Begins update for the NetworkServiceDesignGroup resource. + * + * @return the stage of resource update. + */ + NetworkServiceDesignGroup.Update update(); + + /** The template for NetworkServiceDesignGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkServiceDesignGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkServiceDesignGroup apply(Context context); + } + + /** The NetworkServiceDesignGroup update stages. */ + interface UpdateStages { + /** The stage of the NetworkServiceDesignGroup 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkServiceDesignGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkServiceDesignGroup refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupListResult.java similarity index 63% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupListResult.java index 1e3291cfb0a8..d4095d5d9a6f 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkFunctionVendorListResult.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The network function vendor list result. */ +/** A list of network service design group resources. */ @Fluent -public final class NetworkFunctionVendorListResult { +public final class NetworkServiceDesignGroupListResult { /* - * A list of available network function vendors and skus. + * A list of network service design group. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class NetworkFunctionVendorListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of NetworkFunctionVendorListResult class. */ - public NetworkFunctionVendorListResult() { + /** Creates an instance of NetworkServiceDesignGroupListResult class. */ + public NetworkServiceDesignGroupListResult() { } /** - * Get the value property: A list of available network function vendors and skus. + * Get the value property: A list of network service design group. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of available network function vendors and skus. + * Set the value property: A list of network service design group. * * @param value the value value to set. - * @return the NetworkFunctionVendorListResult object itself. + * @return the NetworkServiceDesignGroupListResult object itself. */ - public NetworkFunctionVendorListResult withValue(List value) { + public NetworkServiceDesignGroupListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupPropertiesFormat.java new file mode 100644 index 000000000000..5b1861f9f923 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroupPropertiesFormat.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** network service design group properties. */ +@Fluent +public final class NetworkServiceDesignGroupPropertiesFormat { + /* + * The provisioning state of the network service design groups resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The network service design group description. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of NetworkServiceDesignGroupPropertiesFormat class. */ + public NetworkServiceDesignGroupPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network service design groups resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the description property: The network service design group description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The network service design group description. + * + * @param description the description value to set. + * @return the NetworkServiceDesignGroupPropertiesFormat object itself. + */ + public NetworkServiceDesignGroupPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroups.java similarity index 51% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroups.java index 9f4b3a816617..04fa69ab5c2d 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendors.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignGroups.java @@ -8,97 +8,114 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Vendors. */ -public interface Vendors { +/** Resource collection API of NetworkServiceDesignGroups. */ +public interface NetworkServiceDesignGroups { /** - * Deletes the specified vendor. + * Gets information of the network service design groups under a publisher. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. */ - void delete(String vendorName); + PagedIterable listByPublisher(String resourceGroupName, String publisherName); /** - * Deletes the specified vendor. + * Gets information of the network service design groups under a publisher. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information of the network service design groups under a publisher as paginated response with {@link + * PagedIterable}. */ - void delete(String vendorName, Context context); + PagedIterable listByPublisher( + String resourceGroupName, String publisherName, Context context); /** - * Gets information about the specified vendor. + * Deletes a specified network service design group. * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor along with {@link Response}. */ - Response getWithResponse(String vendorName, Context context); + void delete(String resourceGroupName, String publisherName, String networkServiceDesignGroupName); /** - * Gets information about the specified vendor. + * Deletes a specified network service design group. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor. */ - Vendor get(String vendorName); + void delete(String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context); /** - * Lists all the vendors in a subscription. + * Gets information about the specified networkServiceDesign group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. + * @return information about the specified networkServiceDesign group along with {@link Response}. */ - PagedIterable list(); + Response getWithResponse( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context); /** - * Lists all the vendors in a subscription. + * Gets information about the specified networkServiceDesign group. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. + * @return information about the specified networkServiceDesign group. */ - PagedIterable list(Context context); + NetworkServiceDesignGroup get(String resourceGroupName, String publisherName, String networkServiceDesignGroupName); /** - * Gets information about the specified vendor. + * Gets information about the specified networkServiceDesign group. * * @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 information about the specified vendor along with {@link Response}. + * @return information about the specified networkServiceDesign group along with {@link Response}. */ - Vendor getById(String id); + NetworkServiceDesignGroup getById(String id); /** - * Gets information about the specified vendor. + * Gets information about the specified networkServiceDesign group. * * @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 information about the specified vendor along with {@link Response}. + * @return information about the specified networkServiceDesign group along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified vendor. + * Deletes a specified network service design group. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -108,7 +125,7 @@ public interface Vendors { void deleteById(String id); /** - * Deletes the specified vendor. + * Deletes a specified network service design group. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -119,10 +136,10 @@ public interface Vendors { void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new Vendor resource. + * Begins definition for a new NetworkServiceDesignGroup resource. * * @param name resource name. - * @return the first stage of the new Vendor definition. + * @return the first stage of the new NetworkServiceDesignGroup definition. */ - Vendor.DefinitionStages.Blank define(String name); + NetworkServiceDesignGroup.DefinitionStages.Blank define(String name); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersion.java new file mode 100644 index 000000000000..2ae8e3b24781 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersion.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkServiceDesignVersion. */ +public interface NetworkServiceDesignVersion { + /** + * 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: network service design version properties. + * + * @return the properties value. + */ + NetworkServiceDesignVersionPropertiesFormat properties(); + + /** + * 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.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner object. + * + * @return the inner object. + */ + NetworkServiceDesignVersionInner innerModel(); + + /** The entirety of the NetworkServiceDesignVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The NetworkServiceDesignVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkServiceDesignVersion definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the NetworkServiceDesignVersion 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the NetworkServiceDesignVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, publisherName, networkServiceDesignGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @return the next definition stage. + */ + WithCreate withExistingNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName); + } + + /** + * The stage of the NetworkServiceDesignVersion 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkServiceDesignVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkServiceDesignVersion create(Context context); + } + + /** The stage of the NetworkServiceDesignVersion 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 NetworkServiceDesignVersion definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: network service design version properties.. + * + * @param properties network service design version properties. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkServiceDesignVersionPropertiesFormat properties); + } + } + + /** + * Begins update for the NetworkServiceDesignVersion resource. + * + * @return the stage of resource update. + */ + NetworkServiceDesignVersion.Update update(); + + /** The template for NetworkServiceDesignVersion update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkServiceDesignVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkServiceDesignVersion apply(Context context); + } + + /** The NetworkServiceDesignVersion update stages. */ + interface UpdateStages { + /** The stage of the NetworkServiceDesignVersion 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkServiceDesignVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkServiceDesignVersion refresh(Context context); + + /** + * Update network service design version state. + * + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + NetworkServiceDesignVersionUpdateState updateState(NetworkServiceDesignVersionUpdateStateInner parameters); + + /** + * Update network service design version state. + * + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + NetworkServiceDesignVersionUpdateState updateState( + NetworkServiceDesignVersionUpdateStateInner parameters, Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionListResult.java new file mode 100644 index 000000000000..014a028db60a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of network service design versions. */ +@Fluent +public final class NetworkServiceDesignVersionListResult { + /* + * A list of network service design versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of NetworkServiceDesignVersionListResult class. */ + public NetworkServiceDesignVersionListResult() { + } + + /** + * Get the value property: A list of network service design versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network service design versions. + * + * @param value the value value to set. + * @return the NetworkServiceDesignVersionListResult object itself. + */ + public NetworkServiceDesignVersionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionPropertiesFormat.java new file mode 100644 index 000000000000..de864bc59295 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionPropertiesFormat.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** network service design version properties. */ +@Fluent +public final class NetworkServiceDesignVersionPropertiesFormat { + /* + * The provisioning state of the network service design version resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The network service design version state. + */ + @JsonProperty(value = "versionState", access = JsonProperty.Access.WRITE_ONLY) + private VersionState versionState; + + /* + * The network service design version description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The configuration schemas to used to define the values. + */ + @JsonProperty(value = "configurationGroupSchemaReferences") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map configurationGroupSchemaReferences; + + /* + * The nfvis from the site. + */ + @JsonProperty(value = "nfvisFromSite") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map nfvisFromSite; + + /* + * List of resource element template + */ + @JsonProperty(value = "resourceElementTemplates") + private List resourceElementTemplates; + + /** Creates an instance of NetworkServiceDesignVersionPropertiesFormat class. */ + public NetworkServiceDesignVersionPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network service design version resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the versionState property: The network service design version state. + * + * @return the versionState value. + */ + public VersionState versionState() { + return this.versionState; + } + + /** + * Get the description property: The network service design version description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The network service design version description. + * + * @param description the description value to set. + * @return the NetworkServiceDesignVersionPropertiesFormat object itself. + */ + public NetworkServiceDesignVersionPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the configurationGroupSchemaReferences property: The configuration schemas to used to define the values. + * + * @return the configurationGroupSchemaReferences value. + */ + public Map configurationGroupSchemaReferences() { + return this.configurationGroupSchemaReferences; + } + + /** + * Set the configurationGroupSchemaReferences property: The configuration schemas to used to define the values. + * + * @param configurationGroupSchemaReferences the configurationGroupSchemaReferences value to set. + * @return the NetworkServiceDesignVersionPropertiesFormat object itself. + */ + public NetworkServiceDesignVersionPropertiesFormat withConfigurationGroupSchemaReferences( + Map configurationGroupSchemaReferences) { + this.configurationGroupSchemaReferences = configurationGroupSchemaReferences; + return this; + } + + /** + * Get the nfvisFromSite property: The nfvis from the site. + * + * @return the nfvisFromSite value. + */ + public Map nfvisFromSite() { + return this.nfvisFromSite; + } + + /** + * Set the nfvisFromSite property: The nfvis from the site. + * + * @param nfvisFromSite the nfvisFromSite value to set. + * @return the NetworkServiceDesignVersionPropertiesFormat object itself. + */ + public NetworkServiceDesignVersionPropertiesFormat withNfvisFromSite(Map nfvisFromSite) { + this.nfvisFromSite = nfvisFromSite; + return this; + } + + /** + * Get the resourceElementTemplates property: List of resource element template. + * + * @return the resourceElementTemplates value. + */ + public List resourceElementTemplates() { + return this.resourceElementTemplates; + } + + /** + * Set the resourceElementTemplates property: List of resource element template. + * + * @param resourceElementTemplates the resourceElementTemplates value to set. + * @return the NetworkServiceDesignVersionPropertiesFormat object itself. + */ + public NetworkServiceDesignVersionPropertiesFormat withResourceElementTemplates( + List resourceElementTemplates) { + this.resourceElementTemplates = resourceElementTemplates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurationGroupSchemaReferences() != null) { + configurationGroupSchemaReferences() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (nfvisFromSite() != null) { + nfvisFromSite() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (resourceElementTemplates() != null) { + resourceElementTemplates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionUpdateState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionUpdateState.java new file mode 100644 index 000000000000..2936c75d0709 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersionUpdateState.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.hybridnetwork.models; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; + +/** An immutable client-side representation of NetworkServiceDesignVersionUpdateState. */ +public interface NetworkServiceDesignVersionUpdateState { + /** + * Gets the versionState property: The network service design version state. + * + * @return the versionState value. + */ + VersionState versionState(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner + * object. + * + * @return the inner object. + */ + NetworkServiceDesignVersionUpdateStateInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersions.java new file mode 100644 index 000000000000..1d327dd54220 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NetworkServiceDesignVersions.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; + +/** Resource collection API of NetworkServiceDesignVersions. */ +public interface NetworkServiceDesignVersions { + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName); + + /** + * Deletes the specified network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context); + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + Context context); + + /** + * Gets information about a network service design version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version. + */ + NetworkServiceDesignVersion get( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName); + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName); + + /** + * Gets information about a list of network service design versions under a network service design group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a list of network service design versions under a network service design group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByNetworkServiceDesignGroup( + String resourceGroupName, String publisherName, String networkServiceDesignGroupName, Context context); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + NetworkServiceDesignVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters); + + /** + * Update network service design version state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param networkServiceDesignGroupName The name of the network service design group. + * @param networkServiceDesignVersionName The name of the network service design version. The name should conform to + * the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + * @param parameters Parameters supplied to update the state of network service design version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher network service design version update request definition. + */ + NetworkServiceDesignVersionUpdateState updateState( + String resourceGroupName, + String publisherName, + String networkServiceDesignGroupName, + String networkServiceDesignVersionName, + NetworkServiceDesignVersionUpdateStateInner parameters, + Context context); + + /** + * Gets information about a network service design version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response}. + */ + NetworkServiceDesignVersion getById(String id); + + /** + * Gets information about a network service design version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a network service design version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified network service design version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network service design version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkServiceDesignVersion resource. + * + * @param name resource name. + * @return the first stage of the new NetworkServiceDesignVersion definition. + */ + NetworkServiceDesignVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfvIs.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfvIs.java new file mode 100644 index 000000000000..35423ef9d23c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfvIs.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The NFVI object. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "nfviType", + defaultImpl = NfvIs.class) +@JsonTypeName("NfvIs") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureCore", value = AzureCoreNfviDetails.class), + @JsonSubTypes.Type(name = "AzureArcKubernetes", value = AzureArcK8SClusterNfviDetails.class), + @JsonSubTypes.Type(name = "AzureOperatorNexus", value = AzureOperatorNexusClusterNfviDetails.class) +}) +@Fluent +public class NfvIs { + /* + * Name of the nfvi. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of NfvIs class. */ + public NfvIs() { + } + + /** + * Get the name property: Name of the nfvi. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the nfvi. + * + * @param name the name value to set. + * @return the NfvIs object itself. + */ + public NfvIs withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviDetails.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviDetails.java new file mode 100644 index 000000000000..8af57bde456e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviDetails.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The nfvi details. */ +@Fluent +public final class NfviDetails { + /* + * The nfvi name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The nfvi type. + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of NfviDetails class. */ + public NfviDetails() { + } + + /** + * Get the name property: The nfvi name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The nfvi name. + * + * @param name the name value to set. + * @return the NfviDetails object itself. + */ + public NfviDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The nfvi type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The nfvi type. + * + * @param type the type value to set. + * @return the NfviDetails object itself. + */ + public NfviDetails withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviType.java new file mode 100644 index 000000000000..3ab16c791ab0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NfviType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The NFVI type. */ +public final class NfviType extends ExpandableStringEnum { + /** Static value Unknown for NfviType. */ + public static final NfviType UNKNOWN = fromString("Unknown"); + + /** Static value AzureArcKubernetes for NfviType. */ + public static final NfviType AZURE_ARC_KUBERNETES = fromString("AzureArcKubernetes"); + + /** Static value AzureCore for NfviType. */ + public static final NfviType AZURE_CORE = fromString("AzureCore"); + + /** Static value AzureOperatorNexus for NfviType. */ + public static final NfviType AZURE_OPERATOR_NEXUS = fromString("AzureOperatorNexus"); + + /** + * Creates a new instance of NfviType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NfviType() { + } + + /** + * Creates or finds a NfviType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NfviType. + */ + @JsonCreator + public static NfviType fromString(String name) { + return fromString(name, NfviType.class); + } + + /** + * Gets known NfviType values. + * + * @return known NfviType values. + */ + public static Collection values() { + return values(NfviType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NsdArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NsdArtifactProfile.java new file mode 100644 index 000000000000..624973bc21ec --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/NsdArtifactProfile.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Artifact profile properties. */ +@Fluent +public final class NsdArtifactProfile { + /* + * The artifact store resource id + */ + @JsonProperty(value = "artifactStoreReference") + private ReferencedResource artifactStoreReference; + + /* + * Artifact name. + */ + @JsonProperty(value = "artifactName") + private String artifactName; + + /* + * Artifact version. + */ + @JsonProperty(value = "artifactVersion") + private String artifactVersion; + + /** Creates an instance of NsdArtifactProfile class. */ + public NsdArtifactProfile() { + } + + /** + * Get the artifactStoreReference property: The artifact store resource id. + * + * @return the artifactStoreReference value. + */ + public ReferencedResource artifactStoreReference() { + return this.artifactStoreReference; + } + + /** + * Set the artifactStoreReference property: The artifact store resource id. + * + * @param artifactStoreReference the artifactStoreReference value to set. + * @return the NsdArtifactProfile object itself. + */ + public NsdArtifactProfile withArtifactStoreReference(ReferencedResource artifactStoreReference) { + this.artifactStoreReference = artifactStoreReference; + return this; + } + + /** + * Get the artifactName property: Artifact name. + * + * @return the artifactName value. + */ + public String artifactName() { + return this.artifactName; + } + + /** + * Set the artifactName property: Artifact name. + * + * @param artifactName the artifactName value to set. + * @return the NsdArtifactProfile object itself. + */ + public NsdArtifactProfile withArtifactName(String artifactName) { + this.artifactName = artifactName; + return this; + } + + /** + * Get the artifactVersion property: Artifact version. + * + * @return the artifactVersion value. + */ + public String artifactVersion() { + return this.artifactVersion; + } + + /** + * Set the artifactVersion property: Artifact version. + * + * @param artifactVersion the artifactVersion value to set. + * @return the NsdArtifactProfile object itself. + */ + public NsdArtifactProfile withArtifactVersion(String artifactVersion) { + this.artifactVersion = artifactVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifactStoreReference() != null) { + artifactStoreReference().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OpenDeploymentResourceReference.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OpenDeploymentResourceReference.java new file mode 100644 index 000000000000..62bd9e0f490d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OpenDeploymentResourceReference.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Non secret deployment resource id reference. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "idType") +@JsonTypeName("Open") +@Fluent +public final class OpenDeploymentResourceReference extends DeploymentResourceIdReference { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of OpenDeploymentResourceReference class. */ + public OpenDeploymentResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the OpenDeploymentResourceReference object itself. + */ + public OpenDeploymentResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.java deleted file mode 100644 index 5f4f880113c3..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperatingSystemTypes.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The OS type. */ -public final class OperatingSystemTypes extends ExpandableStringEnum { - /** Static value Unknown for OperatingSystemTypes. */ - public static final OperatingSystemTypes UNKNOWN = fromString("Unknown"); - - /** Static value Windows for OperatingSystemTypes. */ - public static final OperatingSystemTypes WINDOWS = fromString("Windows"); - - /** Static value Linux for OperatingSystemTypes. */ - public static final OperatingSystemTypes LINUX = fromString("Linux"); - - /** - * Creates or finds a OperatingSystemTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperatingSystemTypes. - */ - @JsonCreator - public static OperatingSystemTypes fromString(String name) { - return fromString(name, OperatingSystemTypes.class); - } - - /** - * Gets known OperatingSystemTypes values. - * - * @return known OperatingSystemTypes values. - */ - public static Collection values() { - return values(OperatingSystemTypes.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java index 11c12247af23..96f57a7fc98e 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Operation.java @@ -9,19 +9,44 @@ /** An immutable client-side representation of Operation. */ public interface Operation { /** - * Gets the name property: Operation name: {provider}/{resource}/{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 display property: The object that represents the operation. + * 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.hybridnetwork.fluent.models.OperationInner object. * diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java index bd918f529af3..d8ef3a795b0a 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationDisplay.java @@ -4,34 +4,37 @@ package com.azure.resourcemanager.hybridnetwork.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The object that represents the operation. */ -@Fluent +/** Localized display information for this particular operation. */ +@Immutable public final class OperationDisplay { /* - * Service provider: Microsoft.HybridNetwork. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ - @JsonProperty(value = "provider") + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource on which the operation is performed: Registration definition, registration assignment, etc. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ - @JsonProperty(value = "resource") + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Operation type: Read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation") + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * Description of the operation. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description") + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** Creates an instance of OperationDisplay class. */ @@ -39,7 +42,8 @@ public OperationDisplay() { } /** - * Get the provider property: Service provider: Microsoft.HybridNetwork. + * 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. */ @@ -48,19 +52,8 @@ public String provider() { } /** - * Set the provider property: Service provider: Microsoft.HybridNetwork. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed: Registration definition, registration - * assignment, etc. + * 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. */ @@ -69,19 +62,8 @@ public String resource() { } /** - * Set the resource property: Resource on which the operation is performed: Registration definition, registration - * assignment, etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. + * 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. */ @@ -90,18 +72,8 @@ public String operation() { } /** - * Set the operation property: Operation type: Read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -109,17 +81,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationListResult.java similarity index 66% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationListResult.java index d95f93624783..de24979882b7 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationList.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationListResult.java @@ -9,27 +9,30 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of the operations. */ +/** + * 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 OperationList { +public final class OperationListResult { /* - * A list of Microsoft.HybridNetwork operations. + * List of operations supported by the resource provider */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * The URL to get the next set of results. + * URL to get the next set of operation list results (if there are any). */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of OperationList class. */ - public OperationList() { + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { } /** - * Get the value property: A list of Microsoft.HybridNetwork operations. + * Get the value property: List of operations supported by the resource provider. * * @return the value value. */ @@ -38,7 +41,7 @@ public List value() { } /** - * Get the nextLink property: The URL to get the next set of results. + * Get the nextLink property: URL to get the next set of operation list results (if there are any). * * @return the nextLink value. */ diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.java deleted file mode 100644 index 50c7b96276e3..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OperationalState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The operational state of the role instance. */ -public final class OperationalState extends ExpandableStringEnum { - /** Static value Unknown for OperationalState. */ - public static final OperationalState UNKNOWN = fromString("Unknown"); - - /** Static value Stopped for OperationalState. */ - public static final OperationalState STOPPED = fromString("Stopped"); - - /** Static value Running for OperationalState. */ - public static final OperationalState RUNNING = fromString("Running"); - - /** Static value Stopping for OperationalState. */ - public static final OperationalState STOPPING = fromString("Stopping"); - - /** Static value Starting for OperationalState. */ - public static final OperationalState STARTING = fromString("Starting"); - - /** - * Creates or finds a OperationalState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationalState. - */ - @JsonCreator - public static OperationalState fromString(String name) { - return fromString(name, OperationalState.class); - } - - /** - * Gets known OperationalState values. - * - * @return known OperationalState values. - */ - public static Collection values() { - return values(OperationalState.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Origin.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Origin.java new file mode 100644 index 000000000000..d39e8ebf27ef --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Origin.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.java deleted file mode 100644 index d70685d60cdc..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsDisk.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Specifies information about the operating system disk used by the virtual machine. <br><br> For more - * information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - */ -@Fluent -public final class OsDisk { - /* - * The OS type. - */ - @JsonProperty(value = "osType") - private OperatingSystemTypes osType; - - /* - * The VHD name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The virtual hard disk. - */ - @JsonProperty(value = "vhd") - private VirtualHardDisk vhd; - - /* - * Specifies the size of os disk in gigabytes. This is the fully expanded disk size needed of the VHD image on the - * ASE. This disk size should be greater than the size of the VHD provided in vhdUri. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /** Creates an instance of OsDisk class. */ - public OsDisk() { - } - - /** - * Get the osType property: The OS type. - * - * @return the osType value. - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType property: The OS type. - * - * @param osType the osType value to set. - * @return the OsDisk object itself. - */ - public OsDisk withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the name property: The VHD name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The VHD name. - * - * @param name the name value to set. - * @return the OsDisk object itself. - */ - public OsDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the vhd property: The virtual hard disk. - * - * @return the vhd value. - */ - public VirtualHardDisk vhd() { - return this.vhd; - } - - /** - * Set the vhd property: The virtual hard disk. - * - * @param vhd the vhd value to set. - * @return the OsDisk object itself. - */ - public OsDisk withVhd(VirtualHardDisk vhd) { - this.vhd = vhd; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of os disk in gigabytes. This is the fully expanded disk size - * needed of the VHD image on the ASE. This disk size should be greater than the size of the VHD provided in vhdUri. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of os disk in gigabytes. This is the fully expanded disk size - * needed of the VHD image on the ASE. This disk size should be greater than the size of the VHD provided in vhdUri. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the OsDisk object itself. - */ - public OsDisk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vhd() != null) { - vhd().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.java deleted file mode 100644 index 3ce00490ef5e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/OsProfile.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the operating system settings for the role instance. */ -@Fluent -public final class OsProfile { - /* - * Specifies the name of the administrator account.

**Windows-only restriction:** Cannot end in "." - *

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", - * "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", - * "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - *

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

- * **Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root - * privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names - * for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "adminUsername") - private String adminUsername; - - /* - * Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux - * distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "linuxConfiguration") - private LinuxConfiguration linuxConfiguration; - - /* - * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that - * is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.

    - * **Note: Do not pass any secrets or passwords in customData property**

    This property cannot be updated - * after the VM is created.

    customData is passed to the VM to be saved as a file. For more information see - * [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) - *

    For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - */ - @JsonProperty(value = "customData") - private String customData; - - /* - * Indicates if custom data is required to deploy this role. - */ - @JsonProperty(value = "customDataRequired") - private Boolean customDataRequired; - - /** Creates an instance of OsProfile class. */ - public OsProfile() { - } - - /** - * Get the adminUsername property: Specifies the name of the administrator account. <br><br> - * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", - * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", - * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", - * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 - * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length - * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root - * privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Set the adminUsername property: Specifies the name of the administrator account. <br><br> - * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", - * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", - * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", - * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 - * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length - * (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root - * privileges on Linux virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> - * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for - * Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param adminUsername the adminUsername value to set. - * @return the OsProfile object itself. - */ - public OsProfile withAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - return this; - } - - /** - * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the linuxConfiguration value. - */ - public LinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. - * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the OsProfile object itself. - */ - public OsProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - - /** - * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file. For more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the customData value. - */ - public String customData() { - return this.customData; - } - - /** - * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is - * decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array - * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** - * <br><br> This property cannot be updated after the VM is created. <br><br> customData is - * passed to the VM to be saved as a file. For more information see [Custom Data on Azure - * VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> - * For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param customData the customData value to set. - * @return the OsProfile object itself. - */ - public OsProfile withCustomData(String customData) { - this.customData = customData; - return this; - } - - /** - * Get the customDataRequired property: Indicates if custom data is required to deploy this role. - * - * @return the customDataRequired value. - */ - public Boolean customDataRequired() { - return this.customDataRequired; - } - - /** - * Set the customDataRequired property: Indicates if custom data is required to deploy this role. - * - * @param customDataRequired the customDataRequired value to set. - * @return the OsProfile object itself. - */ - public OsProfile withCustomDataRequired(Boolean customDataRequired) { - this.customDataRequired = customDataRequired; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Pod.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Pod.java new file mode 100644 index 000000000000..faa5acd09288 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Pod.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Helm Pod status properties. */ +@Fluent +public final class Pod { + /* + * The name of the Pod. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The namespace of the Pod. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Desired number of containers + */ + @JsonProperty(value = "desired") + private Integer desired; + + /* + * Number of ready containers. + */ + @JsonProperty(value = "ready") + private Integer ready; + + /* + * The status of a pod. + */ + @JsonProperty(value = "status") + private PodStatus status; + + /* + * Creation Time of Pod. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /* + * Last 5 Pod events. + */ + @JsonProperty(value = "events") + private List events; + + /** Creates an instance of Pod class. */ + public Pod() { + } + + /** + * Get the name property: The name of the Pod. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Pod. + * + * @param name the name value to set. + * @return the Pod object itself. + */ + public Pod withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the Pod. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the Pod. + * + * @param namespace the namespace value to set. + * @return the Pod object itself. + */ + public Pod withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the desired property: Desired number of containers. + * + * @return the desired value. + */ + public Integer desired() { + return this.desired; + } + + /** + * Set the desired property: Desired number of containers. + * + * @param desired the desired value to set. + * @return the Pod object itself. + */ + public Pod withDesired(Integer desired) { + this.desired = desired; + return this; + } + + /** + * Get the ready property: Number of ready containers. + * + * @return the ready value. + */ + public Integer ready() { + return this.ready; + } + + /** + * Set the ready property: Number of ready containers. + * + * @param ready the ready value to set. + * @return the Pod object itself. + */ + public Pod withReady(Integer ready) { + this.ready = ready; + return this; + } + + /** + * Get the status property: The status of a pod. + * + * @return the status value. + */ + public PodStatus status() { + return this.status; + } + + /** + * Set the status property: The status of a pod. + * + * @param status the status value to set. + * @return the Pod object itself. + */ + public Pod withStatus(PodStatus status) { + this.status = status; + return this; + } + + /** + * Get the creationTime property: Creation Time of Pod. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Creation Time of Pod. + * + * @param creationTime the creationTime value to set. + * @return the Pod object itself. + */ + public Pod withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the events property: Last 5 Pod events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: Last 5 Pod events. + * + * @param events the events value to set. + * @return the Pod object itself. + */ + public Pod withEvents(List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEvent.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEvent.java new file mode 100644 index 000000000000..281b00ab0e4f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEvent.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Pod Event properties. */ +@Fluent +public final class PodEvent { + /* + * The type of pod event. + */ + @JsonProperty(value = "type") + private PodEventType type; + + /* + * Event reason. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Event message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Event Last seen. + */ + @JsonProperty(value = "lastSeenTime") + private OffsetDateTime lastSeenTime; + + /** Creates an instance of PodEvent class. */ + public PodEvent() { + } + + /** + * Get the type property: The type of pod event. + * + * @return the type value. + */ + public PodEventType type() { + return this.type; + } + + /** + * Set the type property: The type of pod event. + * + * @param type the type value to set. + * @return the PodEvent object itself. + */ + public PodEvent withType(PodEventType type) { + this.type = type; + return this; + } + + /** + * Get the reason property: Event reason. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Event reason. + * + * @param reason the reason value to set. + * @return the PodEvent object itself. + */ + public PodEvent withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Event message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Event message. + * + * @param message the message value to set. + * @return the PodEvent object itself. + */ + public PodEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the lastSeenTime property: Event Last seen. + * + * @return the lastSeenTime value. + */ + public OffsetDateTime lastSeenTime() { + return this.lastSeenTime; + } + + /** + * Set the lastSeenTime property: Event Last seen. + * + * @param lastSeenTime the lastSeenTime value to set. + * @return the PodEvent object itself. + */ + public PodEvent withLastSeenTime(OffsetDateTime lastSeenTime) { + this.lastSeenTime = lastSeenTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEventType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEventType.java new file mode 100644 index 000000000000..592f50025366 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodEventType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of pod event. */ +public final class PodEventType extends ExpandableStringEnum { + /** Static value Normal for PodEventType. */ + public static final PodEventType NORMAL = fromString("Normal"); + + /** Static value Warning for PodEventType. */ + public static final PodEventType WARNING = fromString("Warning"); + + /** + * Creates a new instance of PodEventType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PodEventType() { + } + + /** + * Creates or finds a PodEventType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PodEventType. + */ + @JsonCreator + public static PodEventType fromString(String name) { + return fromString(name, PodEventType.class); + } + + /** + * Gets known PodEventType values. + * + * @return known PodEventType values. + */ + public static Collection values() { + return values(PodEventType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodStatus.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodStatus.java new file mode 100644 index 000000000000..671c07fd57dc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PodStatus.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.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of a Pod. */ +public final class PodStatus extends ExpandableStringEnum { + /** Static value Unknown for PodStatus. */ + public static final PodStatus UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for PodStatus. */ + public static final PodStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PodStatus. */ + public static final PodStatus FAILED = fromString("Failed"); + + /** Static value Running for PodStatus. */ + public static final PodStatus RUNNING = fromString("Running"); + + /** Static value Pending for PodStatus. */ + public static final PodStatus PENDING = fromString("Pending"); + + /** Static value Terminating for PodStatus. */ + public static final PodStatus TERMINATING = fromString("Terminating"); + + /** Static value NotReady for PodStatus. */ + public static final PodStatus NOT_READY = fromString("NotReady"); + + /** + * Creates a new instance of PodStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PodStatus() { + } + + /** + * Creates or finds a PodStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PodStatus. + */ + @JsonCreator + public static PodStatus fromString(String name) { + return fromString(name, PodStatus.class); + } + + /** + * Gets known PodStatus values. + * + * @return known PodStatus values. + */ + public static Collection values() { + return values(PodStatus.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.java deleted file mode 100644 index bf3268bc200a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PreviewSubscription.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; - -/** An immutable client-side representation of PreviewSubscription. */ -public interface PreviewSubscription { - /** - * 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 systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the PreviewSubscription resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner object. - * - * @return the inner object. - */ - PreviewSubscriptionInner innerModel(); - - /** The entirety of the PreviewSubscription definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The PreviewSubscription definition stages. */ - interface DefinitionStages { - /** The first stage of the PreviewSubscription definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the PreviewSubscription definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies vendorName, skuName. - * - * @param vendorName The name of the vendor. - * @param skuName The name of the vendor sku. - * @return the next definition stage. - */ - WithCreate withExistingVendorSku(String vendorName, String skuName); - } - /** - * The stage of the PreviewSubscription definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate { - /** - * Executes the create request. - * - * @return the created resource. - */ - PreviewSubscription create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PreviewSubscription create(Context context); - } - } - /** - * Begins update for the PreviewSubscription resource. - * - * @return the stage of resource update. - */ - PreviewSubscription.Update update(); - - /** The template for PreviewSubscription update. */ - interface Update { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PreviewSubscription apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PreviewSubscription apply(Context context); - } - /** The PreviewSubscription update stages. */ - interface UpdateStages { - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PreviewSubscription refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PreviewSubscription refresh(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java index 30f5cf821a69..aefee42515a4 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProvisioningState.java @@ -31,6 +31,18 @@ public final class ProvisioningState extends ExpandableStringEnum value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class VendorNetworkFunctionListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of VendorNetworkFunctionListResult class. */ - public VendorNetworkFunctionListResult() { + /** Creates an instance of ProxyArtifactOverviewListResult class. */ + public ProxyArtifactOverviewListResult() { } /** - * Get the value property: A list of vendor network functions. + * Get the value property: A list of available proxy artifacts. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of vendor network functions. + * Set the value property: A list of available proxy artifacts. * * @param value the value value to set. - * @return the VendorNetworkFunctionListResult object itself. + * @return the ProxyArtifactOverviewListResult object itself. */ - public VendorNetworkFunctionListResult withValue(List value) { + public ProxyArtifactOverviewListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactOverviewPropertiesValue.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactOverviewPropertiesValue.java new file mode 100644 index 000000000000..6ce31544d1d9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactOverviewPropertiesValue.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ProxyArtifactOverviewPropertiesValue model. */ +@Fluent +public final class ProxyArtifactOverviewPropertiesValue { + /* + * The artifact type. + */ + @JsonProperty(value = "artifactType") + private ArtifactType artifactType; + + /* + * The artifact version. + */ + @JsonProperty(value = "artifactVersion") + private String artifactVersion; + + /* + * The artifact state + */ + @JsonProperty(value = "artifactState") + private ArtifactState artifactState; + + /** Creates an instance of ProxyArtifactOverviewPropertiesValue class. */ + public ProxyArtifactOverviewPropertiesValue() { + } + + /** + * Get the artifactType property: The artifact type. + * + * @return the artifactType value. + */ + public ArtifactType artifactType() { + return this.artifactType; + } + + /** + * Set the artifactType property: The artifact type. + * + * @param artifactType the artifactType value to set. + * @return the ProxyArtifactOverviewPropertiesValue object itself. + */ + public ProxyArtifactOverviewPropertiesValue withArtifactType(ArtifactType artifactType) { + this.artifactType = artifactType; + return this; + } + + /** + * Get the artifactVersion property: The artifact version. + * + * @return the artifactVersion value. + */ + public String artifactVersion() { + return this.artifactVersion; + } + + /** + * Set the artifactVersion property: The artifact version. + * + * @param artifactVersion the artifactVersion value to set. + * @return the ProxyArtifactOverviewPropertiesValue object itself. + */ + public ProxyArtifactOverviewPropertiesValue withArtifactVersion(String artifactVersion) { + this.artifactVersion = artifactVersion; + return this; + } + + /** + * Get the artifactState property: The artifact state. + * + * @return the artifactState value. + */ + public ArtifactState artifactState() { + return this.artifactState; + } + + /** + * Set the artifactState property: The artifact state. + * + * @param artifactState the artifactState value to set. + * @return the ProxyArtifactOverviewPropertiesValue object itself. + */ + public ProxyArtifactOverviewPropertiesValue withArtifactState(ArtifactState artifactState) { + this.artifactState = artifactState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsListOverview.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsListOverview.java new file mode 100644 index 000000000000..3b49748e539e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsListOverview.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; + +/** An immutable client-side representation of ProxyArtifactVersionsListOverview. */ +public interface ProxyArtifactVersionsListOverview { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Proxy Artifact overview properties. + * + * @return the properties value. + */ + ProxyArtifactOverviewPropertiesValue properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner + * object. + * + * @return the inner object. + */ + ProxyArtifactVersionsListOverviewInner innerModel(); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsOverviewListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsOverviewListResult.java new file mode 100644 index 000000000000..44cce0a967af --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifactVersionsOverviewListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The proxy artifact list result. */ +@Fluent +public final class ProxyArtifactVersionsOverviewListResult { + /* + * A list of available proxy artifacts. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ProxyArtifactVersionsOverviewListResult class. */ + public ProxyArtifactVersionsOverviewListResult() { + } + + /** + * Get the value property: A list of available proxy artifacts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available proxy artifacts. + * + * @param value the value value to set. + * @return the ProxyArtifactVersionsOverviewListResult object itself. + */ + public ProxyArtifactVersionsOverviewListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifacts.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifacts.java new file mode 100644 index 000000000000..b45c4d81fab6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ProxyArtifacts.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ProxyArtifacts. */ +public interface ProxyArtifacts { + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName); + + /** + * Lists all the available artifacts in the parent Artifact Store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String publisherName, String artifactStoreName, Context context); + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName); + + /** + * Get a Artifact overview information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Artifact overview information as paginated response with {@link PagedIterable}. + */ + PagedIterable get( + String resourceGroupName, String publisherName, String artifactStoreName, String artifactName, Context context); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + ProxyArtifactVersionsListOverview updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters); + + /** + * Change artifact state defined in artifact store. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param artifactStoreName The name of the artifact store. + * @param artifactName The name of the artifact. + * @param artifactVersionName The name of the artifact version. + * @param parameters Parameters supplied to update the state of artifact manifest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the proxy artifact overview. + */ + ProxyArtifactVersionsListOverview updateState( + String resourceGroupName, + String publisherName, + String artifactStoreName, + String artifactName, + String artifactVersionName, + ArtifactChangeState parameters, + Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publisher.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publisher.java new file mode 100644 index 000000000000..dcde72ac49d3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publisher.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner; +import java.util.Map; + +/** An immutable client-side representation of Publisher. */ +public interface Publisher { + /** + * 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: Publisher properties. + * + * @return the properties value. + */ + PublisherPropertiesFormat properties(); + + /** + * Gets the identity property: The managed identity of the publisher, if configured. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * 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.hybridnetwork.fluent.models.PublisherInner object. + * + * @return the inner object. + */ + PublisherInner innerModel(); + + /** The entirety of the Publisher definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The Publisher definition stages. */ + interface DefinitionStages { + /** The first stage of the Publisher definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the Publisher 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 Publisher 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 Publisher 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + Publisher create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Publisher create(Context context); + } + + /** The stage of the Publisher 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 Publisher definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Publisher properties.. + * + * @param properties Publisher properties. + * @return the next definition stage. + */ + WithCreate withProperties(PublisherPropertiesFormat properties); + } + + /** The stage of the Publisher definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity of the publisher, if configured.. + * + * @param identity The managed identity of the publisher, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the Publisher resource. + * + * @return the stage of resource update. + */ + Publisher.Update update(); + + /** The template for Publisher update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Publisher apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Publisher apply(Context context); + } + + /** The Publisher update stages. */ + interface UpdateStages { + /** The stage of the Publisher 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Publisher refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Publisher refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherListResult.java similarity index 67% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherListResult.java index aaf39fc485a2..71dc3f775914 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/DeviceListResult.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response for devices API service call. */ +/** A list of publishers. */ @Fluent -public final class DeviceListResult { +public final class PublisherListResult { /* - * A list of devices. + * A list of publishers. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class DeviceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DeviceListResult class. */ - public DeviceListResult() { + /** Creates an instance of PublisherListResult class. */ + public PublisherListResult() { } /** - * Get the value property: A list of devices. + * Get the value property: A list of publishers. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of devices. + * Set the value property: A list of publishers. * * @param value the value value to set. - * @return the DeviceListResult object itself. + * @return the PublisherListResult object itself. */ - public DeviceListResult withValue(List value) { + public PublisherListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherPropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherPropertiesFormat.java new file mode 100644 index 000000000000..1e69ff43c3bd --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherPropertiesFormat.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** publisher properties. */ +@Fluent +public final class PublisherPropertiesFormat { + /* + * The provisioning state of the publisher resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The publisher scope. + */ + @JsonProperty(value = "scope") + private PublisherScope scope; + + /** Creates an instance of PublisherPropertiesFormat class. */ + public PublisherPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the publisher resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the scope property: The publisher scope. + * + * @return the scope value. + */ + public PublisherScope scope() { + return this.scope; + } + + /** + * Set the scope property: The publisher scope. + * + * @param scope the scope value to set. + * @return the PublisherPropertiesFormat object itself. + */ + public PublisherPropertiesFormat withScope(PublisherScope scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherScope.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherScope.java new file mode 100644 index 000000000000..64737ec1a3e6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/PublisherScope.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Publisher Scope. */ +public final class PublisherScope extends ExpandableStringEnum { + /** Static value Unknown for PublisherScope. */ + public static final PublisherScope UNKNOWN = fromString("Unknown"); + + /** Static value Private for PublisherScope. */ + public static final PublisherScope PRIVATE = fromString("Private"); + + /** + * Creates a new instance of PublisherScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublisherScope() { + } + + /** + * Creates or finds a PublisherScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublisherScope. + */ + @JsonCreator + public static PublisherScope fromString(String name) { + return fromString(name, PublisherScope.class); + } + + /** + * Gets known PublisherScope values. + * + * @return known PublisherScope values. + */ + public static Collection values() { + return values(PublisherScope.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publishers.java similarity index 53% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publishers.java index 1e2b2d286f9b..a19d0e6fba30 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSkus.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Publishers.java @@ -8,104 +8,124 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VendorSkus. */ -public interface VendorSkus { +/** Resource collection API of Publishers. */ +public interface Publishers { /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * Lists all the publishers in a subscription. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 publishers as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String vendorName, String skuName); + PagedIterable list(); /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * Lists all the publishers in a subscription. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 publishers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the publishers in a 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 a list of publishers as paginated response with {@link PagedIterable}. */ - void delete(String vendorName, String skuName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets information about the specified sku. + * Lists all the publishers in a resource group. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. + * @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 information about the specified sku along with {@link Response}. + * @return a list of publishers as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String vendorName, String skuName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets information about the specified sku. + * Deletes the specified publisher. * - * @param vendorName The name of the vendor. - * @param skuName The name of the sku. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified sku. */ - VendorSku get(String vendorName, String skuName); + void deleteByResourceGroup(String resourceGroupName, String publisherName); /** - * Lists all the skus of a vendor. + * Deletes the specified publisher. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. */ - PagedIterable list(String vendorName); + void delete(String resourceGroupName, String publisherName, Context context); /** - * Lists all the skus of a vendor. + * Gets information about the specified publisher. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for list vendor sku API service call as paginated response with {@link PagedIterable}. + * @return information about the specified publisher along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String publisherName, Context context); + + /** + * Gets information about the specified publisher. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publisherName The name of the publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified publisher. */ - PagedIterable list(String vendorName, Context context); + Publisher getByResourceGroup(String resourceGroupName, String publisherName); /** - * Gets information about the specified sku. + * Gets information about the specified publisher. * * @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 information about the specified sku along with {@link Response}. + * @return information about the specified publisher along with {@link Response}. */ - VendorSku getById(String id); + Publisher getById(String id); /** - * Gets information about the specified sku. + * Gets information about the specified publisher. * * @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 information about the specified sku along with {@link Response}. + * @return information about the specified publisher along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * Deletes the specified publisher. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -115,7 +135,7 @@ public interface VendorSkus { void deleteById(String id); /** - * Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. + * Deletes the specified publisher. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -126,10 +146,10 @@ public interface VendorSkus { void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new VendorSku resource. + * Begins definition for a new Publisher resource. * * @param name resource name. - * @return the first stage of the new VendorSku definition. + * @return the first stage of the new Publisher definition. */ - VendorSku.DefinitionStages.Blank define(String name); + Publisher.DefinitionStages.Blank define(String name); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReferencedResource.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReferencedResource.java new file mode 100644 index 000000000000..a8b4c17686c4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReferencedResource.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to another resource. */ +@Fluent +public final class ReferencedResource { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ReferencedResource class. */ + public ReferencedResource() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ReferencedResource object itself. + */ + public ReferencedResource withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReplicaSet.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReplicaSet.java new file mode 100644 index 000000000000..6cfd1b5a904e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ReplicaSet.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Helm ReplicaSet status properties. */ +@Fluent +public final class ReplicaSet { + /* + * The name of the replicaSet. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The namespace of the replicaSet. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Desired number of pods + */ + @JsonProperty(value = "desired") + private Integer desired; + + /* + * Number of ready pods. + */ + @JsonProperty(value = "ready") + private Integer ready; + + /* + * Number of current pods. + */ + @JsonProperty(value = "current") + private Integer current; + + /* + * Creation Time of replicaSet. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /** Creates an instance of ReplicaSet class. */ + public ReplicaSet() { + } + + /** + * Get the name property: The name of the replicaSet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the replicaSet. + * + * @param name the name value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the replicaSet. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the replicaSet. + * + * @param namespace the namespace value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the desired property: Desired number of pods. + * + * @return the desired value. + */ + public Integer desired() { + return this.desired; + } + + /** + * Set the desired property: Desired number of pods. + * + * @param desired the desired value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withDesired(Integer desired) { + this.desired = desired; + return this; + } + + /** + * Get the ready property: Number of ready pods. + * + * @return the ready value. + */ + public Integer ready() { + return this.ready; + } + + /** + * Set the ready property: Number of ready pods. + * + * @param ready the ready value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withReady(Integer ready) { + this.ready = ready; + return this; + } + + /** + * Get the current property: Number of current pods. + * + * @return the current value. + */ + public Integer current() { + return this.current; + } + + /** + * Set the current property: Number of current pods. + * + * @param current the current value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withCurrent(Integer current) { + this.current = current; + return this; + } + + /** + * Get the creationTime property: Creation Time of replicaSet. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Creation Time of replicaSet. + * + * @param creationTime the creationTime value to set. + * @return the ReplicaSet object itself. + */ + public ReplicaSet withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RequestMetadata.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RequestMetadata.java new file mode 100644 index 000000000000..cf98733730b8 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RequestMetadata.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request metadata of execute request post call payload. */ +@Fluent +public final class RequestMetadata { + /* + * The relative path of the request. + */ + @JsonProperty(value = "relativePath", required = true) + private String relativePath; + + /* + * The http method of the request. + */ + @JsonProperty(value = "httpMethod", required = true) + private HttpMethod httpMethod; + + /* + * The serialized body of the request. + */ + @JsonProperty(value = "serializedBody", required = true) + private String serializedBody; + + /* + * The api version of the request. + */ + @JsonProperty(value = "apiVersion") + private String apiVersion; + + /** Creates an instance of RequestMetadata class. */ + public RequestMetadata() { + } + + /** + * Get the relativePath property: The relative path of the request. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: The relative path of the request. + * + * @param relativePath the relativePath value to set. + * @return the RequestMetadata object itself. + */ + public RequestMetadata withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the httpMethod property: The http method of the request. + * + * @return the httpMethod value. + */ + public HttpMethod httpMethod() { + return this.httpMethod; + } + + /** + * Set the httpMethod property: The http method of the request. + * + * @param httpMethod the httpMethod value to set. + * @return the RequestMetadata object itself. + */ + public RequestMetadata withHttpMethod(HttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get the serializedBody property: The serialized body of the request. + * + * @return the serializedBody value. + */ + public String serializedBody() { + return this.serializedBody; + } + + /** + * Set the serializedBody property: The serialized body of the request. + * + * @param serializedBody the serializedBody value to set. + * @return the RequestMetadata object itself. + */ + public RequestMetadata withSerializedBody(String serializedBody) { + this.serializedBody = serializedBody; + return this; + } + + /** + * Get the apiVersion property: The api version of the request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: The api version of the request. + * + * @param apiVersion the apiVersion value to set. + * @return the RequestMetadata object itself. + */ + public RequestMetadata withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (relativePath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property relativePath in model RequestMetadata")); + } + if (httpMethod() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property httpMethod in model RequestMetadata")); + } + if (serializedBody() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property serializedBody in model RequestMetadata")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestMetadata.class); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ResourceElementTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ResourceElementTemplate.java new file mode 100644 index 000000000000..da10d82d48f0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/ResourceElementTemplate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The resource element template object. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ResourceElementTemplate.class) +@JsonTypeName("ResourceElementTemplate") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "ArmResourceDefinition", + value = ArmResourceDefinitionResourceElementTemplateDetails.class), + @JsonSubTypes.Type( + name = "NetworkFunctionDefinition", + value = NetworkFunctionDefinitionResourceElementTemplateDetails.class) +}) +@Fluent +public class ResourceElementTemplate { + /* + * Name of the resource element template. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The depends on profile. + */ + @JsonProperty(value = "dependsOnProfile") + private DependsOnProfile dependsOnProfile; + + /** Creates an instance of ResourceElementTemplate class. */ + public ResourceElementTemplate() { + } + + /** + * Get the name property: Name of the resource element template. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource element template. + * + * @param name the name value to set. + * @return the ResourceElementTemplate object itself. + */ + public ResourceElementTemplate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the dependsOnProfile property: The depends on profile. + * + * @return the dependsOnProfile value. + */ + public DependsOnProfile dependsOnProfile() { + return this.dependsOnProfile; + } + + /** + * Set the dependsOnProfile property: The depends on profile. + * + * @param dependsOnProfile the dependsOnProfile value to set. + * @return the ResourceElementTemplate object itself. + */ + public ResourceElementTemplate withDependsOnProfile(DependsOnProfile dependsOnProfile) { + this.dependsOnProfile = dependsOnProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dependsOnProfile() != null) { + dependsOnProfile().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Resources.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Resources.java new file mode 100644 index 000000000000..32d540c68b95 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Resources.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The resources of the network function component. */ +@Fluent +public final class Resources { + /* + * Deployments that are related to component resource. + */ + @JsonProperty(value = "deployments") + private List deployments; + + /* + * Pods related to component resource. + */ + @JsonProperty(value = "pods") + private List pods; + + /* + * Replica sets related to component resource. + */ + @JsonProperty(value = "replicaSets") + private List replicaSets; + + /* + * Stateful sets related to component resource. + */ + @JsonProperty(value = "statefulSets") + private List statefulSets; + + /* + * Daemonsets related to component resource. + */ + @JsonProperty(value = "daemonSets") + private List daemonSets; + + /** Creates an instance of Resources class. */ + public Resources() { + } + + /** + * Get the deployments property: Deployments that are related to component resource. + * + * @return the deployments value. + */ + public List deployments() { + return this.deployments; + } + + /** + * Set the deployments property: Deployments that are related to component resource. + * + * @param deployments the deployments value to set. + * @return the Resources object itself. + */ + public Resources withDeployments(List deployments) { + this.deployments = deployments; + return this; + } + + /** + * Get the pods property: Pods related to component resource. + * + * @return the pods value. + */ + public List pods() { + return this.pods; + } + + /** + * Set the pods property: Pods related to component resource. + * + * @param pods the pods value to set. + * @return the Resources object itself. + */ + public Resources withPods(List pods) { + this.pods = pods; + return this; + } + + /** + * Get the replicaSets property: Replica sets related to component resource. + * + * @return the replicaSets value. + */ + public List replicaSets() { + return this.replicaSets; + } + + /** + * Set the replicaSets property: Replica sets related to component resource. + * + * @param replicaSets the replicaSets value to set. + * @return the Resources object itself. + */ + public Resources withReplicaSets(List replicaSets) { + this.replicaSets = replicaSets; + return this; + } + + /** + * Get the statefulSets property: Stateful sets related to component resource. + * + * @return the statefulSets value. + */ + public List statefulSets() { + return this.statefulSets; + } + + /** + * Set the statefulSets property: Stateful sets related to component resource. + * + * @param statefulSets the statefulSets value to set. + * @return the Resources object itself. + */ + public Resources withStatefulSets(List statefulSets) { + this.statefulSets = statefulSets; + return this; + } + + /** + * Get the daemonSets property: Daemonsets related to component resource. + * + * @return the daemonSets value. + */ + public List daemonSets() { + return this.daemonSets; + } + + /** + * Set the daemonSets property: Daemonsets related to component resource. + * + * @param daemonSets the daemonSets value to set. + * @return the Resources object itself. + */ + public Resources withDaemonSets(List daemonSets) { + this.daemonSets = daemonSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deployments() != null) { + deployments().forEach(e -> e.validate()); + } + if (pods() != null) { + pods().forEach(e -> e.validate()); + } + if (replicaSets() != null) { + replicaSets().forEach(e -> e.validate()); + } + if (statefulSets() != null) { + statefulSets().forEach(e -> e.validate()); + } + if (daemonSets() != null) { + daemonSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.java deleted file mode 100644 index b65cec0bd6e1..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstance.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; - -/** An immutable client-side representation of RoleInstance. */ -public interface RoleInstance { - /** - * Gets the name property: The role instance name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the id property: The ARM ID of the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the RoleInstance resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the operationalState property: The operational state of the role instance. - * - * @return the operationalState value. - */ - OperationalState operationalState(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner object. - * - * @return the inner object. - */ - RoleInstanceInner innerModel(); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java deleted file mode 100644 index 00666581fa70..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/RoleInstances.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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 RoleInstances. */ -public interface RoleInstances { - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 start(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Starts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 start(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stop(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Powers off (stop) a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stop(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Restarts a role instance of a vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function along with {@link Response}. - */ - Response getWithResponse( - String locationName, String vendorName, String serviceKey, String roleInstanceName, Context context); - - /** - * Gets the information of role instance of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param roleInstanceName The name of the role instance of the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the information of role instance of vendor network function. - */ - RoleInstance get(String locationName, String vendorName, String serviceKey, String roleInstanceName); - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName, String vendorName, String serviceKey); - - /** - * Lists the information of role instances of vendor network function. - * - * @param locationName The Azure region where the network function resource was created by customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of role instances of vendor network function as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName, String vendorName, String serviceKey, Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SecretDeploymentResourceReference.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SecretDeploymentResourceReference.java new file mode 100644 index 000000000000..7265d04684e2 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SecretDeploymentResourceReference.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Secret deployment resource id reference. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "idType") +@JsonTypeName("Secret") +@Fluent +public final class SecretDeploymentResourceReference extends DeploymentResourceIdReference { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of SecretDeploymentResourceReference class. */ + public SecretDeploymentResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the SecretDeploymentResourceReference object itself. + */ + public SecretDeploymentResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Site.java similarity index 65% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Site.java index 8d918bf71f02..6710fa12f706 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Device.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Site.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.models.DeviceInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; import java.util.Map; -/** An immutable client-side representation of Device. */ -public interface Device { +/** An immutable client-side representation of Site. */ +public interface Site { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -49,14 +48,14 @@ public interface Device { Map tags(); /** - * Gets the properties property: Device properties. + * Gets the properties property: Site properties. * * @return the properties value. */ - DevicePropertiesFormat properties(); + SitePropertiesFormat properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -84,25 +83,27 @@ public interface Device { String resourceGroupName(); /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner object. + * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner object. * * @return the inner object. */ - DeviceInner innerModel(); + SiteInner innerModel(); - /** The entirety of the Device definition. */ + /** The entirety of the Site definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Device definition stages. */ + + /** The Site definition stages. */ interface DefinitionStages { - /** The first stage of the Device definition. */ + /** The first stage of the Site definition. */ interface Blank extends WithLocation { } - /** The stage of the Device definition allowing to specify location. */ + + /** The stage of the Site definition allowing to specify location. */ interface WithLocation { /** * Specifies the region for the resource. @@ -120,7 +121,8 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } - /** The stage of the Device definition allowing to specify parent resource. */ + + /** The stage of the Site definition allowing to specify parent resource. */ interface WithResourceGroup { /** * Specifies resourceGroupName. @@ -130,8 +132,9 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** - * The stage of the Device definition which contains all the minimum required properties for the resource to be + * The stage of the Site 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 { @@ -140,7 +143,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro * * @return the created resource. */ - Device create(); + Site create(); /** * Executes the create request. @@ -148,9 +151,10 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro * @param context The context to associate with this operation. * @return the created resource. */ - Device create(Context context); + Site create(Context context); } - /** The stage of the Device definition allowing to specify tags. */ + + /** The stage of the Site definition allowing to specify tags. */ interface WithTags { /** * Specifies the tags property: Resource tags.. @@ -160,32 +164,34 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the Device definition allowing to specify properties. */ + + /** The stage of the Site definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: Device properties.. + * Specifies the properties property: Site properties.. * - * @param properties Device properties. + * @param properties Site properties. * @return the next definition stage. */ - WithCreate withProperties(DevicePropertiesFormat properties); + WithCreate withProperties(SitePropertiesFormat properties); } } + /** - * Begins update for the Device resource. + * Begins update for the Site resource. * * @return the stage of resource update. */ - Device.Update update(); + Site.Update update(); - /** The template for Device update. */ + /** The template for Site update. */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. * * @return the updated resource. */ - Device apply(); + Site apply(); /** * Executes the update request. @@ -193,11 +199,12 @@ interface Update extends UpdateStages.WithTags { * @param context The context to associate with this operation. * @return the updated resource. */ - Device apply(Context context); + Site apply(Context context); } - /** The Device update stages. */ + + /** The Site update stages. */ interface UpdateStages { - /** The stage of the Device update allowing to specify tags. */ + /** The stage of the Site update allowing to specify tags. */ interface WithTags { /** * Specifies the tags property: Resource tags.. @@ -208,12 +215,13 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * * @return the refreshed resource. */ - Device refresh(); + Site refresh(); /** * Refreshes the resource to sync with Azure. @@ -221,25 +229,5 @@ interface WithTags { * @param context The context to associate with this operation. * @return the refreshed resource. */ - Device refresh(Context context); - - /** - * List the registration key for the device. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response}. - */ - Response listRegistrationKeyWithResponse(Context context); - - /** - * List the registration key for the device. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key. - */ - DeviceRegistrationKey listRegistrationKey(); + Site refresh(Context context); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteListResult.java similarity index 67% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteListResult.java index 3990a2765ac5..f4a08fe68480 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorListResult.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.hybridnetwork.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response for vendors API service call. */ +/** Response for sites API service call. */ @Fluent -public final class VendorListResult { +public final class SiteListResult { /* - * A list of vendors. + * A list of sites in a resource group. */ @JsonProperty(value = "value") - private List value; + private List value; /* * The URL to get the next set of results. @@ -24,26 +24,26 @@ public final class VendorListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of VendorListResult class. */ - public VendorListResult() { + /** Creates an instance of SiteListResult class. */ + public SiteListResult() { } /** - * Get the value property: A list of vendors. + * Get the value property: A list of sites in a resource group. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: A list of vendors. + * Set the value property: A list of sites in a resource group. * * @param value the value value to set. - * @return the VendorListResult object itself. + * @return the SiteListResult object itself. */ - public VendorListResult withValue(List value) { + public SiteListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkService.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkService.java new file mode 100644 index 000000000000..6cc8cf5e3dd4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkService.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import java.util.Map; + +/** An immutable client-side representation of SiteNetworkService. */ +public interface SiteNetworkService { + /** + * 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: Site network service properties. + * + * @return the properties value. + */ + SiteNetworkServicePropertiesFormat properties(); + + /** + * Gets the identity property: The managed identity of the Site network service, if configured. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the sku property: Sku of the site network service. + * + * @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.hybridnetwork.fluent.models.SiteNetworkServiceInner object. + * + * @return the inner object. + */ + SiteNetworkServiceInner innerModel(); + + /** The entirety of the SiteNetworkService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The SiteNetworkService definition stages. */ + interface DefinitionStages { + /** The first stage of the SiteNetworkService definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the SiteNetworkService 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 SiteNetworkService 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 SiteNetworkService 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. + */ + SiteNetworkService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SiteNetworkService create(Context context); + } + + /** The stage of the SiteNetworkService 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 SiteNetworkService definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Site network service properties.. + * + * @param properties Site network service properties. + * @return the next definition stage. + */ + WithCreate withProperties(SiteNetworkServicePropertiesFormat properties); + } + + /** The stage of the SiteNetworkService definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity of the Site network service, if configured.. + * + * @param identity The managed identity of the Site network service, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** The stage of the SiteNetworkService definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the site network service.. + * + * @param sku Sku of the site network service. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the SiteNetworkService resource. + * + * @return the stage of resource update. + */ + SiteNetworkService.Update update(); + + /** The template for SiteNetworkService update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SiteNetworkService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SiteNetworkService apply(Context context); + } + + /** The SiteNetworkService update stages. */ + interface UpdateStages { + /** The stage of the SiteNetworkService 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SiteNetworkService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SiteNetworkService refresh(Context context); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServiceListResult.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServiceListResult.java new file mode 100644 index 000000000000..3f85f0268a8e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for site network services API service call. */ +@Fluent +public final class SiteNetworkServiceListResult { + /* + * A list of site network services in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of SiteNetworkServiceListResult class. */ + public SiteNetworkServiceListResult() { + } + + /** + * Get the value property: A list of site network services in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of site network services in a resource group. + * + * @param value the value value to set. + * @return the SiteNetworkServiceListResult object itself. + */ + public SiteNetworkServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServicePropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServicePropertiesFormat.java new file mode 100644 index 000000000000..739fe17161d0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServicePropertiesFormat.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Site network service properties. */ +@Fluent +public final class SiteNetworkServicePropertiesFormat { + /* + * The provisioning state of the site network service resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Managed resource group configuration. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * The site details + */ + @JsonProperty(value = "siteReference") + private ReferencedResource siteReference; + + /* + * The publisher name for the site network service. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * The scope of the publisher. + */ + @JsonProperty(value = "publisherScope", access = JsonProperty.Access.WRITE_ONLY) + private PublisherScope publisherScope; + + /* + * The network service design group name for the site network service. + */ + @JsonProperty(value = "networkServiceDesignGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String networkServiceDesignGroupName; + + /* + * The network service design version for the site network service. + */ + @JsonProperty(value = "networkServiceDesignVersionName", access = JsonProperty.Access.WRITE_ONLY) + private String networkServiceDesignVersionName; + + /* + * The location of the network service design offering. + */ + @JsonProperty(value = "networkServiceDesignVersionOfferingLocation", access = JsonProperty.Access.WRITE_ONLY) + private String networkServiceDesignVersionOfferingLocation; + + /* + * The network service design version resource reference. + */ + @JsonProperty(value = "networkServiceDesignVersionResourceReference") + private DeploymentResourceIdReference networkServiceDesignVersionResourceReference; + + /* + * The goal state of the site network service resource. This has references to the configuration group value + * objects that describe the desired state of the site network service. + */ + @JsonProperty(value = "desiredStateConfigurationGroupValueReferences") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map desiredStateConfigurationGroupValueReferences; + + /* + * The network service design version for the site network service. + */ + @JsonProperty(value = "lastStateNetworkServiceDesignVersionName", access = JsonProperty.Access.WRITE_ONLY) + private String lastStateNetworkServiceDesignVersionName; + + /* + * The last state of the site network service resource. + */ + @JsonProperty(value = "lastStateConfigurationGroupValueReferences", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map lastStateConfigurationGroupValueReferences; + + /** Creates an instance of SiteNetworkServicePropertiesFormat class. */ + public SiteNetworkServicePropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the site network service resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the SiteNetworkServicePropertiesFormat object itself. + */ + public SiteNetworkServicePropertiesFormat withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the siteReference property: The site details. + * + * @return the siteReference value. + */ + public ReferencedResource siteReference() { + return this.siteReference; + } + + /** + * Set the siteReference property: The site details. + * + * @param siteReference the siteReference value to set. + * @return the SiteNetworkServicePropertiesFormat object itself. + */ + public SiteNetworkServicePropertiesFormat withSiteReference(ReferencedResource siteReference) { + this.siteReference = siteReference; + return this; + } + + /** + * Get the publisherName property: The publisher name for the site network service. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the publisherScope property: The scope of the publisher. + * + * @return the publisherScope value. + */ + public PublisherScope publisherScope() { + return this.publisherScope; + } + + /** + * Get the networkServiceDesignGroupName property: The network service design group name for the site network + * service. + * + * @return the networkServiceDesignGroupName value. + */ + public String networkServiceDesignGroupName() { + return this.networkServiceDesignGroupName; + } + + /** + * Get the networkServiceDesignVersionName property: The network service design version for the site network + * service. + * + * @return the networkServiceDesignVersionName value. + */ + public String networkServiceDesignVersionName() { + return this.networkServiceDesignVersionName; + } + + /** + * Get the networkServiceDesignVersionOfferingLocation property: The location of the network service design + * offering. + * + * @return the networkServiceDesignVersionOfferingLocation value. + */ + public String networkServiceDesignVersionOfferingLocation() { + return this.networkServiceDesignVersionOfferingLocation; + } + + /** + * Get the networkServiceDesignVersionResourceReference property: The network service design version resource + * reference. + * + * @return the networkServiceDesignVersionResourceReference value. + */ + public DeploymentResourceIdReference networkServiceDesignVersionResourceReference() { + return this.networkServiceDesignVersionResourceReference; + } + + /** + * Set the networkServiceDesignVersionResourceReference property: The network service design version resource + * reference. + * + * @param networkServiceDesignVersionResourceReference the networkServiceDesignVersionResourceReference value to + * set. + * @return the SiteNetworkServicePropertiesFormat object itself. + */ + public SiteNetworkServicePropertiesFormat withNetworkServiceDesignVersionResourceReference( + DeploymentResourceIdReference networkServiceDesignVersionResourceReference) { + this.networkServiceDesignVersionResourceReference = networkServiceDesignVersionResourceReference; + return this; + } + + /** + * Get the desiredStateConfigurationGroupValueReferences property: The goal state of the site network service + * resource. This has references to the configuration group value objects that describe the desired state of the + * site network service. + * + * @return the desiredStateConfigurationGroupValueReferences value. + */ + public Map desiredStateConfigurationGroupValueReferences() { + return this.desiredStateConfigurationGroupValueReferences; + } + + /** + * Set the desiredStateConfigurationGroupValueReferences property: The goal state of the site network service + * resource. This has references to the configuration group value objects that describe the desired state of the + * site network service. + * + * @param desiredStateConfigurationGroupValueReferences the desiredStateConfigurationGroupValueReferences value to + * set. + * @return the SiteNetworkServicePropertiesFormat object itself. + */ + public SiteNetworkServicePropertiesFormat withDesiredStateConfigurationGroupValueReferences( + Map desiredStateConfigurationGroupValueReferences) { + this.desiredStateConfigurationGroupValueReferences = desiredStateConfigurationGroupValueReferences; + return this; + } + + /** + * Get the lastStateNetworkServiceDesignVersionName property: The network service design version for the site + * network service. + * + * @return the lastStateNetworkServiceDesignVersionName value. + */ + public String lastStateNetworkServiceDesignVersionName() { + return this.lastStateNetworkServiceDesignVersionName; + } + + /** + * Get the lastStateConfigurationGroupValueReferences property: The last state of the site network service resource. + * + * @return the lastStateConfigurationGroupValueReferences value. + */ + public Map lastStateConfigurationGroupValueReferences() { + return this.lastStateConfigurationGroupValueReferences; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (siteReference() != null) { + siteReference().validate(); + } + if (networkServiceDesignVersionResourceReference() != null) { + networkServiceDesignVersionResourceReference().validate(); + } + if (desiredStateConfigurationGroupValueReferences() != null) { + desiredStateConfigurationGroupValueReferences() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (lastStateConfigurationGroupValueReferences() != null) { + lastStateConfigurationGroupValueReferences() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServices.java similarity index 58% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServices.java index 8799081bb7ec..dfb393f0091c 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Devices.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SiteNetworkServices.java @@ -8,150 +8,125 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Devices. */ -public interface Devices { +/** Resource collection API of SiteNetworkServices. */ +public interface SiteNetworkServices { /** - * Deletes the specified device. + * Deletes the specified site network service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteNetworkServiceName The name of the site network service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deviceName); + void deleteByResourceGroup(String resourceGroupName, String siteNetworkServiceName); /** - * Deletes the specified device. + * Deletes the specified site network service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteNetworkServiceName The name of the site network service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deviceName, Context context); + void delete(String resourceGroupName, String siteNetworkServiceName, Context context); /** - * Gets information about the specified device. + * Gets information about the specified site network service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteNetworkServiceName The name of the site network service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device along with {@link Response}. + * @return information about the specified site network service along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String siteNetworkServiceName, Context context); /** - * Gets information about the specified device. + * Gets information about the specified site network service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. + * @param siteNetworkServiceName The name of the site network service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified device. + * @return information about the specified site network service. */ - Device getByResourceGroup(String resourceGroupName, String deviceName); + SiteNetworkService getByResourceGroup(String resourceGroupName, String siteNetworkServiceName); /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Lists all the devices in a subscription. + * Lists all sites in the network service in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); /** - * Lists all the device resource in a resource group. + * Lists all site network services. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all the device resource in a resource group. + * Lists all site network services. * * @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 response for devices API service call as paginated response with {@link PagedIterable}. + * @return response for site network services API service call as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key along with {@link Response}. - */ - Response listRegistrationKeyWithResponse( - String resourceGroupName, String deviceName, Context context); - - /** - * List the registration key for the device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deviceName The name of the device resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device registration key. - */ - DeviceRegistrationKey listRegistrationKey(String resourceGroupName, String deviceName); - - /** - * Gets information about the specified device. + * Gets information about the specified site network service. * * @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 information about the specified device along with {@link Response}. + * @return information about the specified site network service along with {@link Response}. */ - Device getById(String id); + SiteNetworkService getById(String id); /** - * Gets information about the specified device. + * Gets information about the specified site network service. * * @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 information about the specified device along with {@link Response}. + * @return information about the specified site network service along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified device. + * Deletes the specified site network service. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -161,7 +136,7 @@ Response listRegistrationKeyWithResponse( void deleteById(String id); /** - * Deletes the specified device. + * Deletes the specified site network service. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -172,10 +147,10 @@ Response listRegistrationKeyWithResponse( void deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new Device resource. + * Begins definition for a new SiteNetworkService resource. * * @param name resource name. - * @return the first stage of the new Device definition. + * @return the first stage of the new SiteNetworkService definition. */ - Device.DefinitionStages.Blank define(String name); + SiteNetworkService.DefinitionStages.Blank define(String name); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SitePropertiesFormat.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SitePropertiesFormat.java new file mode 100644 index 000000000000..f4f2cf8253b5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SitePropertiesFormat.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Site properties. */ +@Fluent +public final class SitePropertiesFormat { + /* + * The provisioning state of the site resource. **TODO**: Confirm if this is needed. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of NFVIs + */ + @JsonProperty(value = "nfvis") + private List nfvis; + + /* + * The list of site network services on the site. + */ + @JsonProperty(value = "siteNetworkServiceReferences", access = JsonProperty.Access.WRITE_ONLY) + private List siteNetworkServiceReferences; + + /** Creates an instance of SitePropertiesFormat class. */ + public SitePropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the site resource. **TODO**: Confirm if this is + * needed. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the nfvis property: List of NFVIs. + * + * @return the nfvis value. + */ + public List nfvis() { + return this.nfvis; + } + + /** + * Set the nfvis property: List of NFVIs. + * + * @param nfvis the nfvis value to set. + * @return the SitePropertiesFormat object itself. + */ + public SitePropertiesFormat withNfvis(List nfvis) { + this.nfvis = nfvis; + return this; + } + + /** + * Get the siteNetworkServiceReferences property: The list of site network services on the site. + * + * @return the siteNetworkServiceReferences value. + */ + public List siteNetworkServiceReferences() { + return this.siteNetworkServiceReferences; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nfvis() != null) { + nfvis().forEach(e -> e.validate()); + } + if (siteNetworkServiceReferences() != null) { + siteNetworkServiceReferences().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sites.java similarity index 54% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sites.java index dd25e7853f35..3426ae0dff13 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorsClient.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sites.java @@ -2,164 +2,154 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridnetwork.fluent; +package com.azure.resourcemanager.hybridnetwork.models; -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.hybridnetwork.fluent.models.VendorInner; -/** An instance of this class provides access to all the operations defined in VendorsClient. */ -public interface VendorsClient { +/** Resource collection API of Sites. */ +public interface Sites { /** - * Deletes the specified vendor. + * Deletes the specified network site. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 vendorName); + void deleteByResourceGroup(String resourceGroupName, String siteName); /** - * Deletes the specified vendor. + * Deletes the specified network site. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteName The name of the network service site. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 vendorName, Context context); + void delete(String resourceGroupName, String siteName, Context context); /** - * Deletes the specified vendor. + * Gets information about the specified network site. * - * @param vendorName The name of the vendor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteName The name of the network service site. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network site along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vendorName); + Response getByResourceGroupWithResponse(String resourceGroupName, String siteName, Context context); /** - * Deletes the specified vendor. + * Gets information about the specified network site. * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param siteName The name of the network service site. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network site. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vendorName, Context context); + Site getByResourceGroup(String resourceGroupName, String siteName); /** - * Gets information about the specified vendor. + * Lists all sites in the network service in a subscription. * - * @param vendorName The name of the vendor. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor along with {@link Response}. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vendorName, Context context); + PagedIterable list(); /** - * Gets information about the specified vendor. + * Lists all sites in the network service in a subscription. * - * @param vendorName The name of the vendor. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorInner get(String vendorName); + PagedIterable list(Context context); /** - * Creates or updates a vendor. + * Lists all sites in the network service. * - * @param vendorName The name of the vendor. + * @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 {@link SyncPoller} for polling of vendor resource. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorInner> beginCreateOrUpdate(String vendorName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Creates or updates a vendor. + * Lists all sites in the network service. * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. + * @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 {@link SyncPoller} for polling of vendor resource. + * @return response for sites API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VendorInner> beginCreateOrUpdate( - String vendorName, VendorInner parameters, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Creates or updates a vendor. + * Gets information about the specified network site. * - * @param vendorName The name of the vendor. + * @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 vendor resource. + * @return information about the specified network site along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorInner createOrUpdate(String vendorName); + Site getById(String id); /** - * Creates or updates a vendor. + * Gets information about the specified network site. * - * @param vendorName The name of the vendor. - * @param parameters Parameters supplied to the create vendor operation. + * @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 vendor resource. + * @return information about the specified network site along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VendorInner createOrUpdate(String vendorName, VendorInner parameters, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Lists all the vendors in a subscription. + * Deletes the specified network site. * + * @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 response for vendors API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + void deleteById(String id); /** - * Lists all the vendors in a subscription. + * Deletes the specified network site. * + * @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 response for vendors API service call as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Site resource. + * + * @param name resource name. + * @return the first stage of the new Site definition. + */ + Site.DefinitionStages.Blank define(String name); } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sku.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sku.java new file mode 100644 index 000000000000..191e42e2ce19 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Sku.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku, to be associated with a SiteNetworkService. */ +@Fluent +public final class Sku { + /* + * Name of this Sku + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: Name of this Sku. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of this Sku. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.java deleted file mode 100644 index 710cd4a90977..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuDeploymentMode.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The sku deployment mode. */ -public final class SkuDeploymentMode extends ExpandableStringEnum { - /** Static value Unknown for SkuDeploymentMode. */ - public static final SkuDeploymentMode UNKNOWN = fromString("Unknown"); - - /** Static value Azure for SkuDeploymentMode. */ - public static final SkuDeploymentMode AZURE = fromString("Azure"); - - /** Static value PrivateEdgeZone for SkuDeploymentMode. */ - public static final SkuDeploymentMode PRIVATE_EDGE_ZONE = fromString("PrivateEdgeZone"); - - /** - * Creates or finds a SkuDeploymentMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuDeploymentMode. - */ - @JsonCreator - public static SkuDeploymentMode fromString(String name) { - return fromString(name, SkuDeploymentMode.class); - } - - /** - * Gets known SkuDeploymentMode values. - * - * @return known SkuDeploymentMode values. - */ - public static Collection values() { - return values(SkuDeploymentMode.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuName.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuName.java new file mode 100644 index 000000000000..d32a91231691 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Name of this Sku. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java deleted file mode 100644 index 4955f450f49f..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuOverview.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; - -/** An immutable client-side representation of SkuOverview. */ -public interface SkuOverview { - /** - * Gets the skuName property: The vendor sku name. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the skuType property: The vendor sku type. - * - * @return the skuType value. - */ - SkuType skuType(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner object. - * - * @return the inner object. - */ - SkuOverviewInner innerModel(); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuTier.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuTier.java new file mode 100644 index 000000000000..efbc3550f40a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuTier.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SKU tier based on the SKU name. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuTier() { + } + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * Gets known SkuTier values. + * + * @return known SkuTier values. + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.java deleted file mode 100644 index e2bce113e237..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SkuType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Sku type. */ -public final class SkuType extends ExpandableStringEnum { - /** Static value Unknown for SkuType. */ - public static final SkuType UNKNOWN = fromString("Unknown"); - - /** Static value EvolvedPacketCore for SkuType. */ - public static final SkuType EVOLVED_PACKET_CORE = fromString("EvolvedPacketCore"); - - /** Static value SDWAN for SkuType. */ - public static final SkuType SDWAN = fromString("SDWAN"); - - /** Static value Firewall for SkuType. */ - public static final SkuType FIREWALL = fromString("Firewall"); - - /** - * Creates or finds a SkuType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuType. - */ - @JsonCreator - public static SkuType fromString(String name) { - return fromString(name, SkuType.class); - } - - /** - * Gets known SkuType values. - * - * @return known SkuType values. - */ - public static Collection values() { - return values(SkuType.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.java deleted file mode 100644 index 74ce1a436234..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** SSH configuration for Linux based VMs running on Azure. */ -@Fluent -public final class SshConfiguration { - /* - * The list of SSH public keys used to authenticate with linux based VMs. - */ - @JsonProperty(value = "publicKeys") - private List publicKeys; - - /** Creates an instance of SshConfiguration class. */ - public SshConfiguration() { - } - - /** - * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * - * @return the publicKeys value. - */ - public List publicKeys() { - return this.publicKeys; - } - - /** - * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * - * @param publicKeys the publicKeys value to set. - * @return the SshConfiguration object itself. - */ - public SshConfiguration withPublicKeys(List publicKeys) { - this.publicKeys = publicKeys; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicKeys() != null) { - publicKeys().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java deleted file mode 100644 index 4c819bb9b473..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/SshPublicKey.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. - */ -@Fluent -public final class SshPublicKey { - /* - * Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the - * specified key is appended to the file. Example: /home/user/.ssh/authorized_keys - */ - @JsonProperty(value = "path") - private String path; - - /* - * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit - * and in ssh-rsa format.

    For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - */ - @JsonProperty(value = "keyData") - private String keyData; - - /** Creates an instance of SshPublicKey class. */ - public SshPublicKey() { - } - - /** - * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file - * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file - * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. - * - * @param path the path value to set. - * @return the SshPublicKey object itself. - */ - public SshPublicKey withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs - * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys - * on Linux and Mac for Linux VMs in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @return the keyData value. - */ - public String keyData() { - return this.keyData; - } - - /** - * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs - * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys - * on Linux and Mac for Linux VMs in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - * - * @param keyData the keyData value to set. - * @return the SshPublicKey object itself. - */ - public SshPublicKey withKeyData(String keyData) { - this.keyData = keyData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StatefulSet.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StatefulSet.java new file mode 100644 index 000000000000..67c7df3fabe1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StatefulSet.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Helm StatefulSet status properties. */ +@Fluent +public final class StatefulSet { + /* + * The name of the statefulset. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The namespace of the statefulset. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * Desired number of pods + */ + @JsonProperty(value = "desired") + private Integer desired; + + /* + * Number of ready pods. + */ + @JsonProperty(value = "ready") + private Integer ready; + + /* + * Creation Time of statefulset. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /** Creates an instance of StatefulSet class. */ + public StatefulSet() { + } + + /** + * Get the name property: The name of the statefulset. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the statefulset. + * + * @param name the name value to set. + * @return the StatefulSet object itself. + */ + public StatefulSet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the statefulset. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the statefulset. + * + * @param namespace the namespace value to set. + * @return the StatefulSet object itself. + */ + public StatefulSet withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the desired property: Desired number of pods. + * + * @return the desired value. + */ + public Integer desired() { + return this.desired; + } + + /** + * Set the desired property: Desired number of pods. + * + * @param desired the desired value to set. + * @return the StatefulSet object itself. + */ + public StatefulSet withDesired(Integer desired) { + this.desired = desired; + return this; + } + + /** + * Get the ready property: Number of ready pods. + * + * @return the ready value. + */ + public Integer ready() { + return this.ready; + } + + /** + * Set the ready property: Number of ready pods. + * + * @param ready the ready value to set. + * @return the StatefulSet object itself. + */ + public StatefulSet withReady(Integer ready) { + this.ready = ready; + return this; + } + + /** + * Get the creationTime property: Creation Time of statefulset. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Creation Time of statefulset. + * + * @param creationTime the creationTime value to set. + * @return the StatefulSet object itself. + */ + public StatefulSet withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java index d39db48bc346..38df6f6119c8 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Status.java @@ -8,19 +8,58 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current device status. */ +/** The component resource deployment status. */ public final class Status extends ExpandableStringEnum { /** Static value Unknown for Status. */ public static final Status UNKNOWN = fromString("Unknown"); - /** Static value NotRegistered for Status. */ - public static final Status NOT_REGISTERED = fromString("NotRegistered"); + /** Static value Deployed for Status. */ + public static final Status DEPLOYED = fromString("Deployed"); - /** Static value Registered for Status. */ - public static final Status REGISTERED = fromString("Registered"); + /** Static value Uninstalled for Status. */ + public static final Status UNINSTALLED = fromString("Uninstalled"); - /** Static value Deleted for Status. */ - public static final Status DELETED = fromString("Deleted"); + /** Static value Superseded for Status. */ + public static final Status SUPERSEDED = fromString("Superseded"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value Uninstalling for Status. */ + public static final Status UNINSTALLING = fromString("Uninstalling"); + + /** Static value Pending-Install for Status. */ + public static final Status PENDING_INSTALL = fromString("Pending-Install"); + + /** Static value Pending-Upgrade for Status. */ + public static final Status PENDING_UPGRADE = fromString("Pending-Upgrade"); + + /** Static value Pending-Rollback for Status. */ + public static final Status PENDING_ROLLBACK = fromString("Pending-Rollback"); + + /** Static value Downloading for Status. */ + public static final Status DOWNLOADING = fromString("Downloading"); + + /** Static value Installing for Status. */ + public static final Status INSTALLING = fromString("Installing"); + + /** Static value Reinstalling for Status. */ + public static final Status REINSTALLING = fromString("Reinstalling"); + + /** Static value Rollingback for Status. */ + public static final Status ROLLINGBACK = fromString("Rollingback"); + + /** Static value Upgrading for Status. */ + public static final Status UPGRADING = fromString("Upgrading"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } /** * Creates or finds a Status from its string representation. diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.java deleted file mode 100644 index 55d14cc83fc5..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/StorageProfile.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the storage settings for the virtual machine disks. */ -@Fluent -public final class StorageProfile { - /* - * The image reference properties. - */ - @JsonProperty(value = "imageReference") - private ImageReference imageReference; - - /* - * Specifies information about the operating system disk used by the virtual machine. - */ - @JsonProperty(value = "osDisk") - private OsDisk osDisk; - - /* - * Specifies the parameters that are used to add a data disk to a virtual machine. - */ - @JsonProperty(value = "dataDisks") - private List dataDisks; - - /** Creates an instance of StorageProfile class. */ - public StorageProfile() { - } - - /** - * Get the imageReference property: The image reference properties. - * - * @return the imageReference value. - */ - public ImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: The image reference properties. - * - * @param imageReference the imageReference value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withImageReference(ImageReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * - * @return the osDisk value. - */ - public OsDisk osDisk() { - return this.osDisk; - } - - /** - * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. - * - * @param osDisk the osDisk value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withOsDisk(OsDisk osDisk) { - this.osDisk = osDisk; - return this; - } - - /** - * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * - * @return the dataDisks value. - */ - public List dataDisks() { - return this.dataDisks; - } - - /** - * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. - * - * @param dataDisks the dataDisks value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (imageReference() != null) { - imageReference().validate(); - } - if (osDisk() != null) { - osDisk().validate(); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TemplateType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TemplateType.java new file mode 100644 index 000000000000..d3edb14724d7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/TemplateType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The template type. */ +public final class TemplateType extends ExpandableStringEnum { + /** Static value Unknown for TemplateType. */ + public static final TemplateType UNKNOWN = fromString("Unknown"); + + /** Static value ArmTemplate for TemplateType. */ + public static final TemplateType ARM_TEMPLATE = fromString("ArmTemplate"); + + /** + * Creates a new instance of TemplateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TemplateType() { + } + + /** + * Creates or finds a TemplateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TemplateType. + */ + @JsonCreator + public static TemplateType fromString(String name) { + return fromString(name, TemplateType.class); + } + + /** + * Gets known TemplateType values. + * + * @return known TemplateType values. + */ + public static Collection values() { + return values(TemplateType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Type.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Type.java new file mode 100644 index 000000000000..8c4d338f34c1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Type.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The resource element template type. */ +public final class Type extends ExpandableStringEnum { + /** Static value Unknown for Type. */ + public static final Type UNKNOWN = fromString("Unknown"); + + /** Static value ArmResourceDefinition for Type. */ + public static final Type ARM_RESOURCE_DEFINITION = fromString("ArmResourceDefinition"); + + /** Static value NetworkFunctionDefinition for Type. */ + public static final Type NETWORK_FUNCTION_DEFINITION = fromString("NetworkFunctionDefinition"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/UserAssignedIdentity.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..14e0862e9c80 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.java deleted file mode 100644 index 63c3e0520aaa..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VMSwitchType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the VM switch. */ -public final class VMSwitchType extends ExpandableStringEnum { - /** Static value Unknown for VMSwitchType. */ - public static final VMSwitchType UNKNOWN = fromString("Unknown"); - - /** Static value Management for VMSwitchType. */ - public static final VMSwitchType MANAGEMENT = fromString("Management"); - - /** Static value Wan for VMSwitchType. */ - public static final VMSwitchType WAN = fromString("Wan"); - - /** Static value Lan for VMSwitchType. */ - public static final VMSwitchType LAN = fromString("Lan"); - - /** - * Creates or finds a VMSwitchType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMSwitchType. - */ - @JsonCreator - public static VMSwitchType fromString(String name) { - return fromString(name, VMSwitchType.class); - } - - /** - * Gets known VMSwitchType values. - * - * @return known VMSwitchType values. - */ - public static Collection values() { - return values(VMSwitchType.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.java deleted file mode 100644 index a6c33e6eb998..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/Vendor.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.management.SubResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import java.util.List; - -/** An immutable client-side representation of Vendor. */ -public interface Vendor { - /** - * 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 systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the vendor resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the skus property: A list of IDs of the vendor skus offered by the vendor. - * - * @return the skus value. - */ - List skus(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner object. - * - * @return the inner object. - */ - VendorInner innerModel(); - - /** The entirety of the Vendor definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The Vendor definition stages. */ - interface DefinitionStages { - /** The first stage of the Vendor definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the Vendor definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate { - /** - * Executes the create request. - * - * @return the created resource. - */ - Vendor create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Vendor create(Context context); - } - } - /** - * Begins update for the Vendor resource. - * - * @return the stage of resource update. - */ - Vendor.Update update(); - - /** The template for Vendor update. */ - interface Update { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Vendor apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Vendor apply(Context context); - } - /** The Vendor update stages. */ - interface UpdateStages { - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Vendor refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Vendor refresh(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java deleted file mode 100644 index 73e04d5e8324..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunction.java +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import java.util.List; - -/** An immutable client-side representation of VendorNetworkFunction. */ -public interface VendorNetworkFunction { - /** - * 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 systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the vendor network function sub resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the vendorProvisioningState property: The vendor controlled provisioning state of the vendor network - * function. - * - * @return the vendorProvisioningState value. - */ - VendorProvisioningState vendorProvisioningState(); - - /** - * Gets the skuName property: The name of the sku. Once set, it cannot be updated. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the skuType property: The sku type. - * - * @return the skuType value. - */ - SkuType skuType(); - - /** - * Gets the networkFunctionVendorConfigurations property: An array of network function vendor configurations. - * - * @return the networkFunctionVendorConfigurations value. - */ - List networkFunctionVendorConfigurations(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner object. - * - * @return the inner object. - */ - VendorNetworkFunctionInner innerModel(); - - /** The entirety of the VendorNetworkFunction definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The VendorNetworkFunction definition stages. */ - interface DefinitionStages { - /** The first stage of the VendorNetworkFunction definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the VendorNetworkFunction definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies locationName, vendorName. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @return the next definition stage. - */ - WithCreate withExistingVendor(String locationName, String vendorName); - } - /** - * The stage of the VendorNetworkFunction 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.WithVendorProvisioningState, - DefinitionStages.WithNetworkFunctionVendorConfigurations { - /** - * Executes the create request. - * - * @return the created resource. - */ - VendorNetworkFunction create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - VendorNetworkFunction create(Context context); - } - /** The stage of the VendorNetworkFunction definition allowing to specify vendorProvisioningState. */ - interface WithVendorProvisioningState { - /** - * Specifies the vendorProvisioningState property: The vendor controlled provisioning state of the vendor - * network function.. - * - * @param vendorProvisioningState The vendor controlled provisioning state of the vendor network function. - * @return the next definition stage. - */ - WithCreate withVendorProvisioningState(VendorProvisioningState vendorProvisioningState); - } - /** - * The stage of the VendorNetworkFunction definition allowing to specify networkFunctionVendorConfigurations. - */ - interface WithNetworkFunctionVendorConfigurations { - /** - * Specifies the networkFunctionVendorConfigurations property: An array of network function vendor - * configurations.. - * - * @param networkFunctionVendorConfigurations An array of network function vendor configurations. - * @return the next definition stage. - */ - WithCreate withNetworkFunctionVendorConfigurations( - List networkFunctionVendorConfigurations); - } - } - /** - * Begins update for the VendorNetworkFunction resource. - * - * @return the stage of resource update. - */ - VendorNetworkFunction.Update update(); - - /** The template for VendorNetworkFunction update. */ - interface Update - extends UpdateStages.WithVendorProvisioningState, UpdateStages.WithNetworkFunctionVendorConfigurations { - /** - * Executes the update request. - * - * @return the updated resource. - */ - VendorNetworkFunction apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - VendorNetworkFunction apply(Context context); - } - /** The VendorNetworkFunction update stages. */ - interface UpdateStages { - /** The stage of the VendorNetworkFunction update allowing to specify vendorProvisioningState. */ - interface WithVendorProvisioningState { - /** - * Specifies the vendorProvisioningState property: The vendor controlled provisioning state of the vendor - * network function.. - * - * @param vendorProvisioningState The vendor controlled provisioning state of the vendor network function. - * @return the next definition stage. - */ - Update withVendorProvisioningState(VendorProvisioningState vendorProvisioningState); - } - /** The stage of the VendorNetworkFunction update allowing to specify networkFunctionVendorConfigurations. */ - interface WithNetworkFunctionVendorConfigurations { - /** - * Specifies the networkFunctionVendorConfigurations property: An array of network function vendor - * configurations.. - * - * @param networkFunctionVendorConfigurations An array of network function vendor configurations. - * @return the next definition stage. - */ - Update withNetworkFunctionVendorConfigurations( - List networkFunctionVendorConfigurations); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - VendorNetworkFunction refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - VendorNetworkFunction refresh(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java deleted file mode 100644 index f73a05d6f7fa..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorNetworkFunctions.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.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 VendorNetworkFunctions. */ -public interface VendorNetworkFunctions { - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function along with {@link Response}. - */ - Response getWithResponse( - String locationName, String vendorName, String serviceKey, Context context); - - /** - * Gets information about the specified vendor network function. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param serviceKey The GUID for the vendor network function. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified vendor network function. - */ - VendorNetworkFunction get(String locationName, String vendorName, String serviceKey); - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName, String vendorName); - - /** - * Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, - * vendorProvisioningState. - * - * @param locationName The Azure region where the network function resource was created by the customer. - * @param vendorName The name of the vendor. - * @param filter The filter to apply on the operation. The properties you can use for eq (equals) are: skuType, - * skuName and vendorProvisioningState. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for vendors API service call as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName, String vendorName, String filter, Context context); - - /** - * Gets information about the specified vendor network function. - * - * @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 information about the specified vendor network function along with {@link Response}. - */ - VendorNetworkFunction getById(String id); - - /** - * Gets information about the specified vendor network function. - * - * @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 information about the specified vendor network function along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new VendorNetworkFunction resource. - * - * @param name resource name. - * @return the first stage of the new VendorNetworkFunction definition. - */ - VendorNetworkFunction.DefinitionStages.Blank define(String name); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.java deleted file mode 100644 index c388df301f69..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorProvisioningState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The current vendor provisioning state. */ -public final class VendorProvisioningState extends ExpandableStringEnum { - /** Static value Unknown for VendorProvisioningState. */ - public static final VendorProvisioningState UNKNOWN = fromString("Unknown"); - - /** Static value NotProvisioned for VendorProvisioningState. */ - public static final VendorProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); - - /** Static value Provisioning for VendorProvisioningState. */ - public static final VendorProvisioningState PROVISIONING = fromString("Provisioning"); - - /** Static value Provisioned for VendorProvisioningState. */ - public static final VendorProvisioningState PROVISIONED = fromString("Provisioned"); - - /** Static value Deprovisioned for VendorProvisioningState. */ - public static final VendorProvisioningState DEPROVISIONED = fromString("Deprovisioned"); - - /** Static value UserDataValidationFailed for VendorProvisioningState. */ - public static final VendorProvisioningState USER_DATA_VALIDATION_FAILED = fromString("UserDataValidationFailed"); - - /** - * Creates or finds a VendorProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding VendorProvisioningState. - */ - @JsonCreator - public static VendorProvisioningState fromString(String name) { - return fromString(name, VendorProvisioningState.class); - } - - /** - * Gets known VendorProvisioningState values. - * - * @return known VendorProvisioningState values. - */ - public static Collection values() { - return values(VendorProvisioningState.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java deleted file mode 100644 index 8d1291e1ef0c..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VendorSku.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; - -/** An immutable client-side representation of VendorSku. */ -public interface VendorSku { - /** - * 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 systemData property: The system meta data relating to this resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the vendor sku sub resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the skuType property: The sku type. - * - * @return the skuType value. - */ - SkuType skuType(); - - /** - * Gets the deploymentMode property: The sku deployment mode. - * - * @return the deploymentMode value. - */ - SkuDeploymentMode deploymentMode(); - - /** - * Gets the networkFunctionType property: The network function type. - * - * @return the networkFunctionType value. - */ - NetworkFunctionType networkFunctionType(); - - /** - * Gets the preview property: Indicates if the vendor sku is in preview mode. - * - * @return the preview value. - */ - Boolean preview(); - - /** - * Gets the managedApplicationParameters property: The parameters for the managed application to be supplied by the - * vendor. - * - * @return the managedApplicationParameters value. - */ - Object managedApplicationParameters(); - - /** - * Gets the managedApplicationTemplate property: The template for the managed application deployment. - * - * @return the managedApplicationTemplate value. - */ - Object managedApplicationTemplate(); - - /** - * Gets the networkFunctionTemplate property: The template definition of the network function. - * - * @return the networkFunctionTemplate value. - */ - NetworkFunctionTemplate networkFunctionTemplate(); - - /** - * Gets the inner com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner object. - * - * @return the inner object. - */ - VendorSkuInner innerModel(); - - /** The entirety of the VendorSku definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The VendorSku definition stages. */ - interface DefinitionStages { - /** The first stage of the VendorSku definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the VendorSku definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies vendorName. - * - * @param vendorName The name of the vendor. - * @return the next definition stage. - */ - WithCreate withExistingVendor(String vendorName); - } - /** - * The stage of the VendorSku 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.WithSkuType, - DefinitionStages.WithDeploymentMode, - DefinitionStages.WithNetworkFunctionType, - DefinitionStages.WithPreview, - DefinitionStages.WithManagedApplicationParameters, - DefinitionStages.WithManagedApplicationTemplate, - DefinitionStages.WithNetworkFunctionTemplate { - /** - * Executes the create request. - * - * @return the created resource. - */ - VendorSku create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - VendorSku create(Context context); - } - /** The stage of the VendorSku definition allowing to specify skuType. */ - interface WithSkuType { - /** - * Specifies the skuType property: The sku type.. - * - * @param skuType The sku type. - * @return the next definition stage. - */ - WithCreate withSkuType(SkuType skuType); - } - /** The stage of the VendorSku definition allowing to specify deploymentMode. */ - interface WithDeploymentMode { - /** - * Specifies the deploymentMode property: The sku deployment mode.. - * - * @param deploymentMode The sku deployment mode. - * @return the next definition stage. - */ - WithCreate withDeploymentMode(SkuDeploymentMode deploymentMode); - } - /** The stage of the VendorSku definition allowing to specify networkFunctionType. */ - interface WithNetworkFunctionType { - /** - * Specifies the networkFunctionType property: The network function type.. - * - * @param networkFunctionType The network function type. - * @return the next definition stage. - */ - WithCreate withNetworkFunctionType(NetworkFunctionType networkFunctionType); - } - /** The stage of the VendorSku definition allowing to specify preview. */ - interface WithPreview { - /** - * Specifies the preview property: Indicates if the vendor sku is in preview mode.. - * - * @param preview Indicates if the vendor sku is in preview mode. - * @return the next definition stage. - */ - WithCreate withPreview(Boolean preview); - } - /** The stage of the VendorSku definition allowing to specify managedApplicationParameters. */ - interface WithManagedApplicationParameters { - /** - * Specifies the managedApplicationParameters property: The parameters for the managed application to be - * supplied by the vendor.. - * - * @param managedApplicationParameters The parameters for the managed application to be supplied by the - * vendor. - * @return the next definition stage. - */ - WithCreate withManagedApplicationParameters(Object managedApplicationParameters); - } - /** The stage of the VendorSku definition allowing to specify managedApplicationTemplate. */ - interface WithManagedApplicationTemplate { - /** - * Specifies the managedApplicationTemplate property: The template for the managed application deployment.. - * - * @param managedApplicationTemplate The template for the managed application deployment. - * @return the next definition stage. - */ - WithCreate withManagedApplicationTemplate(Object managedApplicationTemplate); - } - /** The stage of the VendorSku definition allowing to specify networkFunctionTemplate. */ - interface WithNetworkFunctionTemplate { - /** - * Specifies the networkFunctionTemplate property: The template definition of the network function.. - * - * @param networkFunctionTemplate The template definition of the network function. - * @return the next definition stage. - */ - WithCreate withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate); - } - } - /** - * Begins update for the VendorSku resource. - * - * @return the stage of resource update. - */ - VendorSku.Update update(); - - /** The template for VendorSku update. */ - interface Update - extends UpdateStages.WithSkuType, - UpdateStages.WithDeploymentMode, - UpdateStages.WithNetworkFunctionType, - UpdateStages.WithPreview, - UpdateStages.WithManagedApplicationParameters, - UpdateStages.WithManagedApplicationTemplate, - UpdateStages.WithNetworkFunctionTemplate { - /** - * Executes the update request. - * - * @return the updated resource. - */ - VendorSku apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - VendorSku apply(Context context); - } - /** The VendorSku update stages. */ - interface UpdateStages { - /** The stage of the VendorSku update allowing to specify skuType. */ - interface WithSkuType { - /** - * Specifies the skuType property: The sku type.. - * - * @param skuType The sku type. - * @return the next definition stage. - */ - Update withSkuType(SkuType skuType); - } - /** The stage of the VendorSku update allowing to specify deploymentMode. */ - interface WithDeploymentMode { - /** - * Specifies the deploymentMode property: The sku deployment mode.. - * - * @param deploymentMode The sku deployment mode. - * @return the next definition stage. - */ - Update withDeploymentMode(SkuDeploymentMode deploymentMode); - } - /** The stage of the VendorSku update allowing to specify networkFunctionType. */ - interface WithNetworkFunctionType { - /** - * Specifies the networkFunctionType property: The network function type.. - * - * @param networkFunctionType The network function type. - * @return the next definition stage. - */ - Update withNetworkFunctionType(NetworkFunctionType networkFunctionType); - } - /** The stage of the VendorSku update allowing to specify preview. */ - interface WithPreview { - /** - * Specifies the preview property: Indicates if the vendor sku is in preview mode.. - * - * @param preview Indicates if the vendor sku is in preview mode. - * @return the next definition stage. - */ - Update withPreview(Boolean preview); - } - /** The stage of the VendorSku update allowing to specify managedApplicationParameters. */ - interface WithManagedApplicationParameters { - /** - * Specifies the managedApplicationParameters property: The parameters for the managed application to be - * supplied by the vendor.. - * - * @param managedApplicationParameters The parameters for the managed application to be supplied by the - * vendor. - * @return the next definition stage. - */ - Update withManagedApplicationParameters(Object managedApplicationParameters); - } - /** The stage of the VendorSku update allowing to specify managedApplicationTemplate. */ - interface WithManagedApplicationTemplate { - /** - * Specifies the managedApplicationTemplate property: The template for the managed application deployment.. - * - * @param managedApplicationTemplate The template for the managed application deployment. - * @return the next definition stage. - */ - Update withManagedApplicationTemplate(Object managedApplicationTemplate); - } - /** The stage of the VendorSku update allowing to specify networkFunctionTemplate. */ - interface WithNetworkFunctionTemplate { - /** - * Specifies the networkFunctionTemplate property: The template definition of the network function.. - * - * @param networkFunctionTemplate The template definition of the network function. - * @return the next definition stage. - */ - Update withNetworkFunctionTemplate(NetworkFunctionTemplate networkFunctionTemplate); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - VendorSku refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - VendorSku refresh(Context context); -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VersionState.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VersionState.java new file mode 100644 index 000000000000..c3175ab9e47b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VersionState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The configuration group schema state. */ +public final class VersionState extends ExpandableStringEnum { + /** Static value Unknown for VersionState. */ + public static final VersionState UNKNOWN = fromString("Unknown"); + + /** Static value Preview for VersionState. */ + public static final VersionState PREVIEW = fromString("Preview"); + + /** Static value Active for VersionState. */ + public static final VersionState ACTIVE = fromString("Active"); + + /** Static value Deprecated for VersionState. */ + public static final VersionState DEPRECATED = fromString("Deprecated"); + + /** Static value Validating for VersionState. */ + public static final VersionState VALIDATING = fromString("Validating"); + + /** Static value ValidationFailed for VersionState. */ + public static final VersionState VALIDATION_FAILED = fromString("ValidationFailed"); + + /** + * Creates a new instance of VersionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VersionState() { + } + + /** + * Creates or finds a VersionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VersionState. + */ + @JsonCreator + public static VersionState fromString(String name) { + return fromString(name, VersionState.class); + } + + /** + * Gets known VersionState values. + * + * @return known VersionState values. + */ + public static Collection values() { + return values(VersionState.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageArtifactProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageArtifactProfile.java new file mode 100644 index 000000000000..682545604371 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageArtifactProfile.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.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vhd artifact profile. */ +@Fluent +public final class VhdImageArtifactProfile { + /* + * Vhd name. + */ + @JsonProperty(value = "vhdName") + private String vhdName; + + /* + * Vhd version. + */ + @JsonProperty(value = "vhdVersion") + private String vhdVersion; + + /** Creates an instance of VhdImageArtifactProfile class. */ + public VhdImageArtifactProfile() { + } + + /** + * Get the vhdName property: Vhd name. + * + * @return the vhdName value. + */ + public String vhdName() { + return this.vhdName; + } + + /** + * Set the vhdName property: Vhd name. + * + * @param vhdName the vhdName value to set. + * @return the VhdImageArtifactProfile object itself. + */ + public VhdImageArtifactProfile withVhdName(String vhdName) { + this.vhdName = vhdName; + return this; + } + + /** + * Get the vhdVersion property: Vhd version. + * + * @return the vhdVersion value. + */ + public String vhdVersion() { + return this.vhdVersion; + } + + /** + * Set the vhdVersion property: Vhd version. + * + * @param vhdVersion the vhdVersion value to set. + * @return the VhdImageArtifactProfile object itself. + */ + public VhdImageArtifactProfile withVhdVersion(String vhdVersion) { + this.vhdVersion = vhdVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageMappingRuleProfile.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageMappingRuleProfile.java new file mode 100644 index 000000000000..6debef06b13c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VhdImageMappingRuleProfile.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vhd mapping rule profile. */ +@Fluent +public final class VhdImageMappingRuleProfile { + /* + * List of values. + */ + @JsonProperty(value = "userConfiguration") + private String userConfiguration; + + /** Creates an instance of VhdImageMappingRuleProfile class. */ + public VhdImageMappingRuleProfile() { + } + + /** + * Get the userConfiguration property: List of values. + * + * @return the userConfiguration value. + */ + public String userConfiguration() { + return this.userConfiguration; + } + + /** + * Set the userConfiguration property: List of values. + * + * @param userConfiguration the userConfiguration value to set. + * @return the VhdImageMappingRuleProfile object itself. + */ + public VhdImageMappingRuleProfile withUserConfiguration(String userConfiguration) { + this.userConfiguration = userConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.java deleted file mode 100644 index 1663f9f8c3b9..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualHardDisk.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the uri of a disk. */ -@Fluent -public final class VirtualHardDisk { - /* - * Specifies the virtual hard disk's uri. - */ - @JsonProperty(value = "uri") - private String uri; - - /** Creates an instance of VirtualHardDisk class. */ - public VirtualHardDisk() { - } - - /** - * Get the uri property: Specifies the virtual hard disk's uri. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: Specifies the virtual hard disk's uri. - * - * @param uri the uri value to set. - * @return the VirtualHardDisk object itself. - */ - public VirtualHardDisk withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.java deleted file mode 100644 index 5f22ed356474..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualMachineSizeTypes.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The size of the virtual machine. */ -public final class VirtualMachineSizeTypes extends ExpandableStringEnum { - /** Static value Unknown for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes UNKNOWN = fromString("Unknown"); - - /** Static value Standard_D1_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); - - /** Static value Standard_D2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); - - /** Static value Standard_D3_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); - - /** Static value Standard_D4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); - - /** Static value Standard_D5_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); - - /** Static value Standard_D11_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); - - /** Static value Standard_D12_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); - - /** Static value Standard_D13_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); - - /** Static value Standard_DS1_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); - - /** Static value Standard_DS2_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); - - /** Static value Standard_DS3_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); - - /** Static value Standard_DS4_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - - /** Static value Standard_DS5_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - - /** Static value Standard_DS11_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); - - /** Static value Standard_DS12_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - - /** Static value Standard_DS13_v2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - - /** Static value Standard_F1 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F1 = fromString("Standard_F1"); - - /** Static value Standard_F2 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F2 = fromString("Standard_F2"); - - /** Static value Standard_F4 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F4 = fromString("Standard_F4"); - - /** Static value Standard_F8 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F8 = fromString("Standard_F8"); - - /** Static value Standard_F16 for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F16 = fromString("Standard_F16"); - - /** Static value Standard_F1s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F1S = fromString("Standard_F1s"); - - /** Static value Standard_F2s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F2S = fromString("Standard_F2s"); - - /** Static value Standard_F4s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F4S = fromString("Standard_F4s"); - - /** Static value Standard_F8s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F8S = fromString("Standard_F8s"); - - /** Static value Standard_F16s for VirtualMachineSizeTypes. */ - public static final VirtualMachineSizeTypes STANDARD_F16S = fromString("Standard_F16s"); - - /** - * Creates or finds a VirtualMachineSizeTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding VirtualMachineSizeTypes. - */ - @JsonCreator - public static VirtualMachineSizeTypes fromString(String name) { - return fromString(name, VirtualMachineSizeTypes.class); - } - - /** - * Gets known VirtualMachineSizeTypes values. - * - * @return known VirtualMachineSizeTypes values. - */ - public static Collection values() { - return values(VirtualMachineSizeTypes.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionDefinitionVersion.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionDefinitionVersion.java new file mode 100644 index 000000000000..cba1f30e1df7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionDefinitionVersion.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Virtual network function network function definition version properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "networkFunctionType") +@JsonTypeName("VirtualNetworkFunction") +@Fluent +public final class VirtualNetworkFunctionDefinitionVersion extends NetworkFunctionDefinitionVersionPropertiesFormat { + /* + * Virtual network function template. + */ + @JsonProperty(value = "networkFunctionTemplate") + private VirtualNetworkFunctionTemplate networkFunctionTemplate; + + /** Creates an instance of VirtualNetworkFunctionDefinitionVersion class. */ + public VirtualNetworkFunctionDefinitionVersion() { + } + + /** + * Get the networkFunctionTemplate property: Virtual network function template. + * + * @return the networkFunctionTemplate value. + */ + public VirtualNetworkFunctionTemplate networkFunctionTemplate() { + return this.networkFunctionTemplate; + } + + /** + * Set the networkFunctionTemplate property: Virtual network function template. + * + * @param networkFunctionTemplate the networkFunctionTemplate value to set. + * @return the VirtualNetworkFunctionDefinitionVersion object itself. + */ + public VirtualNetworkFunctionDefinitionVersion withNetworkFunctionTemplate( + VirtualNetworkFunctionTemplate networkFunctionTemplate) { + this.networkFunctionTemplate = networkFunctionTemplate; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkFunctionDefinitionVersion withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkFunctionDefinitionVersion withDeployParameters(String deployParameters) { + super.withDeployParameters(deployParameters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFunctionTemplate() != null) { + networkFunctionTemplate().validate(); + } + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionNfviType.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionNfviType.java new file mode 100644 index 000000000000..ddba342a45d3 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionNfviType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The network function type. */ +public final class VirtualNetworkFunctionNfviType extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkFunctionNfviType. */ + public static final VirtualNetworkFunctionNfviType UNKNOWN = fromString("Unknown"); + + /** Static value AzureCore for VirtualNetworkFunctionNfviType. */ + public static final VirtualNetworkFunctionNfviType AZURE_CORE = fromString("AzureCore"); + + /** Static value AzureOperatorNexus for VirtualNetworkFunctionNfviType. */ + public static final VirtualNetworkFunctionNfviType AZURE_OPERATOR_NEXUS = fromString("AzureOperatorNexus"); + + /** + * Creates a new instance of VirtualNetworkFunctionNfviType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkFunctionNfviType() { + } + + /** + * Creates or finds a VirtualNetworkFunctionNfviType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkFunctionNfviType. + */ + @JsonCreator + public static VirtualNetworkFunctionNfviType fromString(String name) { + return fromString(name, VirtualNetworkFunctionNfviType.class); + } + + /** + * Gets known VirtualNetworkFunctionNfviType values. + * + * @return known VirtualNetworkFunctionNfviType values. + */ + public static Collection values() { + return values(VirtualNetworkFunctionNfviType.class); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionTemplate.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionTemplate.java new file mode 100644 index 000000000000..6315f53ed522 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/models/VirtualNetworkFunctionTemplate.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Virtual network function template. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "nfviType", + defaultImpl = VirtualNetworkFunctionTemplate.class) +@JsonTypeName("VirtualNetworkFunctionTemplate") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureCore", value = AzureCoreNetworkFunctionTemplate.class), + @JsonSubTypes.Type(name = "AzureOperatorNexus", value = AzureOperatorNexusNetworkFunctionTemplate.class) +}) +@Immutable +public class VirtualNetworkFunctionTemplate { + /** Creates an instance of VirtualNetworkFunctionTemplate class. */ + public VirtualNetworkFunctionTemplate() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/proxy-config.json b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/proxy-config.json new file mode 100644 index 000000000000..0d5df343e300 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.hybridnetwork.implementation.ConfigurationGroupSchemasClientImpl$ConfigurationGroupSchemasService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.ConfigurationGroupValuesClientImpl$ConfigurationGroupValuesService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionsClientImpl$NetworkFunctionsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.ComponentsClientImpl$ComponentsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionDefinitionGroupsClientImpl$NetworkFunctionDefinitionGroupsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.NetworkFunctionDefinitionVersionsClientImpl$NetworkFunctionDefinitionVersionsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.NetworkServiceDesignGroupsClientImpl$NetworkServiceDesignGroupsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.NetworkServiceDesignVersionsClientImpl$NetworkServiceDesignVersionsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.PublishersClientImpl$PublishersService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.ArtifactStoresClientImpl$ArtifactStoresService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.ArtifactManifestsClientImpl$ArtifactManifestsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.ProxyArtifactsClientImpl$ProxyArtifactsService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.SitesClientImpl$SitesService" ], [ "com.azure.resourcemanager.hybridnetwork.implementation.SiteNetworkServicesClientImpl$SiteNetworkServicesService" ] ] \ No newline at end of file diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/reflect-config.json b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/reflect-config.json new file mode 100644 index 000000000000..84749ce2c407 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridnetwork/reflect-config.json @@ -0,0 +1,816 @@ +[ { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.TagsObject", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupValueInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValuePropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.DeploymentResourceIdReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValueListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.RequestMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ComponentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ComponentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.DeploymentStatusProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Resources", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Deployment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Pod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PodEvent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ReplicaSet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.StatefulSet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.DaemonSet", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ComponentListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroupListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroupPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroupListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroupPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ReferencedResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NfviDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ResourceElementTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.DependsOnProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PublisherListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.PublisherInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PublisherPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactStoreListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactStoreInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestPropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ManifestArtifactFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactAccessCredentialInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactOverviewListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactListOverviewInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactVersionsOverviewListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.ProxyArtifactVersionsListOverviewInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ProxyArtifactOverviewPropertiesValue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeStateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.SiteInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SitePropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NfvIs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SiteListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.fluent.models.SiteNetworkServiceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServicePropertiesFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ManagedResourceGroupConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Sku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServiceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.MappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureContainerRegistryScopedTokenCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureStorageAccountCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureStorageAccountContainerCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithSecrets", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithoutSecrets", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithSecrets", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithoutSecrets", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ContainerizedNetworkFunctionDefinitionVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ContainerizedNetworkFunctionTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VirtualNetworkFunctionDefinitionVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VirtualNetworkFunctionTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesNetworkFunctionTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesNetworkFunctionApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesHelmApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HelmArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesDeployMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfileOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HelmInstallOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HelmUpgradeOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionVhdApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VhdImageArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageDeployMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VhdImageMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionArmTemplateApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArmTemplateArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArmTemplateMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionImageApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ImageArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ImageMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionArmTemplateApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplateDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NsdArtifactProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionResourceElementTemplateDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreNfviDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcK8SClusterNfviDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusClusterNfviDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VersionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PublisherScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.IdType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValueConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NfviType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.HttpMethod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Status", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PodStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.PodEventType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Type", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactStoreType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactReplicationStrategy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.CredentialType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ArtifactState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SkuName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.SkuTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ApplicationEnablement", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.ContainerizedNetworkFunctionNfviType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.VirtualNetworkFunctionNfviType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesArtifactType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureCoreArtifactType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArtifactType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridnetwork.models.TemplateType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c3f023f922a1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactType; +import com.azure.resourcemanager.hybridnetwork.models.ManifestArtifactFormat; +import java.util.Arrays; + +/** Samples for ArtifactManifests CreateOrUpdate. */ +public final class ArtifactManifestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestCreate.json + */ + /** + * Sample code: Create or update the artifact manifest resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheArtifactManifestResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .define("TestManifest") + .withRegion("eastus") + .withExistingArtifactStore("rg", "TestPublisher", "TestArtifactStore") + .withProperties( + new ArtifactManifestPropertiesFormat() + .withArtifacts( + Arrays + .asList( + new ManifestArtifactFormat() + .withArtifactName("fed-rbac") + .withArtifactType(ArtifactType.OCIARTIFACT) + .withArtifactVersion("1.0.0"), + new ManifestArtifactFormat() + .withArtifactName("nginx") + .withArtifactType(ArtifactType.OCIARTIFACT) + .withArtifactVersion("v1")))) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsDeleteSamples.java new file mode 100644 index 000000000000..48fe8ec989aa --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ArtifactManifests Delete. */ +public final class ArtifactManifestsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestDelete.json + */ + /** + * Sample code: Delete a artifact manifest resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteAArtifactManifestResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .delete("rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsGetSamples.java new file mode 100644 index 000000000000..237776650ec9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ArtifactManifests Get. */ +public final class ArtifactManifestsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestGet.json + */ + /** + * Sample code: Get a artifact manifest resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getAArtifactManifestResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .getWithResponse( + "rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListByArtifactStoreSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListByArtifactStoreSamples.java new file mode 100644 index 000000000000..7705b83000cd --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListByArtifactStoreSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ArtifactManifests ListByArtifactStore. */ +public final class ArtifactManifestsListByArtifactStoreSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestListByArtifactStore.json + */ + /** + * Sample code: Get artifact manifest list resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getArtifactManifestListResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .listByArtifactStore("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListCredentialSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListCredentialSamples.java new file mode 100644 index 000000000000..8e5e6b6afb2a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsListCredentialSamples.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.hybridnetwork.generated; + +/** Samples for ArtifactManifests ListCredential. */ +public final class ArtifactManifestsListCredentialSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestListCredential.json + */ + /** + * Sample code: List a credential for artifact manifest. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listACredentialForArtifactManifest( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .listCredentialWithResponse( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateSamples.java new file mode 100644 index 000000000000..dd6279f7ec17 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifest; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactManifests Update. */ +public final class ArtifactManifestsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestUpdateTags.json + */ + /** + * Sample code: Update a artifact manifest resource tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateAArtifactManifestResourceTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + ArtifactManifest resource = + manager + .artifactManifests() + .getWithResponse( + "rg", "TestPublisher", "TestArtifactStore", "TestManifest", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateStateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateStateSamples.java new file mode 100644 index 000000000000..87f0c52917e1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactManifestsUpdateStateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ArtifactManifestUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactManifestState; + +/** Samples for ArtifactManifests UpdateState. */ +public final class ArtifactManifestsUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactManifestUpdateState.json + */ + /** + * Sample code: Update artifact manifest state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateArtifactManifestState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactManifests() + .updateState( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + new ArtifactManifestUpdateStateInner().withArtifactManifestState(ArtifactManifestState.UPLOADED), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresCreateOrUpdateSamples.java new file mode 100644 index 000000000000..03c0865f84b4 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ArtifactReplicationStrategy; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStoreType; + +/** Samples for ArtifactStores CreateOrUpdate. */ +public final class ArtifactStoresCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreCreate.json + */ + /** + * Sample code: Create or update an artifact store of publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateAnArtifactStoreOfPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactStores() + .define("TestArtifactStore") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") + .withProperties( + new ArtifactStorePropertiesFormat() + .withStoreType(ArtifactStoreType.AZURE_CONTAINER_REGISTRY) + .withReplicationStrategy(ArtifactReplicationStrategy.SINGLE_REPLICATION) + .withManagedResourceGroupConfiguration( + new ArtifactStorePropertiesFormatManagedResourceGroupConfiguration() + .withName("testRg") + .withLocation("eastus"))) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresDeleteSamples.java similarity index 52% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresDeleteSamples.java index f8fb9c592290..41f4c614b24f 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresDeleteSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for VendorNetworkFunctions List. */ -public final class VendorNetworkFunctionsListSamples { +/** Samples for ArtifactStores Delete. */ +public final class ArtifactStoresDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfListByVendor.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreDelete.json */ /** - * Sample code: List all nfs of vendor resource. + * Sample code: Delete a artifact store of publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllNfsOfVendorResource( + public static void deleteAArtifactStoreOfPublisherResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorNetworkFunctions().list("eastus", "testVendor", null, Context.NONE); + manager.artifactStores().delete("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresGetSamples.java similarity index 50% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusGetSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresGetSamples.java index b5c0eaa70924..8590ca68e61c 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusGetSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresGetSamples.java @@ -4,19 +4,19 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for VendorSkus Get. */ -public final class VendorSkusGetSamples { +/** Samples for ArtifactStores Get. */ +public final class ArtifactStoresGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreGet.json */ /** - * Sample code: Get the sku of vendor resource. + * Sample code: Get a artifact store resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getTheSkuOfVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().getWithResponse("TestVendor", "TestSku", Context.NONE); + public static void getAArtifactStoreResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .artifactStores() + .getWithResponse("rg", "TestPublisher", "TestArtifactStoreName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresListByPublisherSamples.java similarity index 50% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresListByPublisherSamples.java index 1bcd65221112..9d9c72402156 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresListByPublisherSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for NetworkFunctionVendorSkus ListBySku. */ -public final class NetworkFunctionVendorSkusListBySkuSamples { +/** Samples for ArtifactStores ListByPublisher. */ +public final class ArtifactStoresListByPublisherSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuDetailsGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoresListByPublisherName.json */ /** - * Sample code: Get network function sku details. + * Sample code: Get application groups under a publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getNetworkFunctionSkuDetails( + public static void getApplicationGroupsUnderAPublisherResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendorSkus().listBySku("testVendor", "testSku", Context.NONE); + manager.artifactStores().listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesUpdateTagsSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresUpdateSamples.java similarity index 60% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesUpdateTagsSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresUpdateSamples.java index 2881b9acb654..7e3086aad835 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesUpdateTagsSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ArtifactStoresUpdateSamples.java @@ -4,28 +4,31 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.models.Device; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactStore; import java.util.HashMap; import java.util.Map; -/** Samples for Devices UpdateTags. */ -public final class DevicesUpdateTagsSamples { +/** Samples for ArtifactStores Update. */ +public final class ArtifactStoresUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceUpdateTags.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ArtifactStoreUpdateTags.json */ /** - * Sample code: Update hybrid network device tags. + * Sample code: Update artifact store resource tags. * * @param manager Entry point to HybridNetworkManager. */ - public static void updateHybridNetworkDeviceTags( + public static void updateArtifactStoreResourceTags( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - Device resource = - manager.devices().getByResourceGroupWithResponse("rg1", "TestDevice", Context.NONE).getValue(); + ArtifactStore resource = + manager + .artifactStores() + .getWithResponse("rg", "TestPublisher", "TestArtifactStore", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsGetSamples.java similarity index 53% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsGetSamples.java index 0d7ebda1efa7..82f0c01cb2eb 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsGetSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Devices Delete. */ -public final class DevicesDeleteSamples { +/** Samples for Components Get. */ +public final class ComponentsGetSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ComponentGet.json */ /** - * Sample code: Delete device resource. + * Sample code: Get component resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void deleteDeviceResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().delete("rg1", "TestDevice", Context.NONE); + public static void getComponentResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.components().getWithResponse("rg", "testNf", "testComponent", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsListByNetworkFunctionSamples.java similarity index 52% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsListByNetworkFunctionSamples.java index f74797234197..41ec21b1732a 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ComponentsListByNetworkFunctionSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Devices ListByResourceGroup. */ -public final class DevicesListByResourceGroupSamples { +/** Samples for Components ListByNetworkFunction. */ +public final class ComponentsListByNetworkFunctionSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListByResourceGroup.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ComponentListByNetworkFunction.json */ /** - * Sample code: List all devices in resource group. + * Sample code: List components in network function. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllDevicesInResourceGroup( + public static void listComponentsInNetworkFunction( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().listByResourceGroup("rg1", Context.NONE); + manager.components().listByNetworkFunction("rg", "testNf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasCreateOrUpdateSamples.java new file mode 100644 index 000000000000..abadb727cf2f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchemaPropertiesFormat; + +/** Samples for ConfigurationGroupSchemas CreateOrUpdate. */ +public final class ConfigurationGroupSchemasCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaCreate.json + */ + /** + * Sample code: Create or update the network function definition group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkFunctionDefinitionGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupSchemas() + .define("testConfigurationGroupSchema") + .withRegion("westUs2") + .withExistingPublisher("rg1", "testPublisher") + .withProperties( + new ConfigurationGroupSchemaPropertiesFormat() + .withDescription("Schema with no secrets") + .withSchemaDefinition( + "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}")) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasDeleteSamples.java new file mode 100644 index 000000000000..2c80a2158cad --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupSchemas Delete. */ +public final class ConfigurationGroupSchemasDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaDelete.json + */ + /** + * Sample code: Delete a network function group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupSchemas() + .delete("rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasGetSamples.java new file mode 100644 index 000000000000..2c311cfd8ebe --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupSchemas Get. */ +public final class ConfigurationGroupSchemasGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaGet.json + */ + /** + * Sample code: Get a networkFunctionDefinition group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkFunctionDefinitionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupSchemas() + .getWithResponse("rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasListByPublisherSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasListByPublisherSamples.java new file mode 100644 index 000000000000..d226834828a9 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasListByPublisherSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupSchemas ListByPublisher. */ +public final class ConfigurationGroupSchemasListByPublisherSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaListByPublisherName.json + */ + /** + * Sample code: Get networkFunctionDefinition groups under publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionGroupsUnderPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.configurationGroupSchemas().listByPublisher("rg1", "testPublisher", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateSamples.java new file mode 100644 index 000000000000..f90918bf6a65 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupSchema; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ConfigurationGroupSchemas Update. */ +public final class ConfigurationGroupSchemasUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaUpdateTags.json + */ + /** + * Sample code: Create or update the configuration group schema resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheConfigurationGroupSchemaResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + ConfigurationGroupSchema resource = + manager + .configurationGroupSchemas() + .getWithResponse( + "rg1", "testPublisher", "testConfigurationGroupSchema", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateStateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateStateSamples.java new file mode 100644 index 000000000000..72202a964108 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupSchemasUpdateStateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.ConfigurationGroupSchemaVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +/** Samples for ConfigurationGroupSchemas UpdateState. */ +public final class ConfigurationGroupSchemasUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupSchemaVersionUpdateState.json + */ + /** + * Sample code: Update network service design version state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkServiceDesignVersionState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupSchemas() + .updateState( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + new ConfigurationGroupSchemaVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8309b971d2ce --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesCreateOrUpdateSamples.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.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithSecrets; +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationValueWithoutSecrets; +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; + +/** Samples for ConfigurationGroupValues CreateOrUpdate. */ +public final class ConfigurationGroupValuesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueCreate.json + */ + /** + * Sample code: Create or update configuration group value. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateConfigurationGroupValue( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithoutSecrets() + .withConfigurationGroupSchemaResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withConfigurationValue( + "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe" + + " one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe" + + " two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC" + + " 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC" + + " 2\",\"interconnects\":\"stripe-two\"}}}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueFirstPartyCreate.json + */ + /** + * Sample code: Create or update first party configuration group value. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateFirstPartyConfigurationGroupValue( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithoutSecrets() + .withConfigurationGroupSchemaResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withConfigurationValue( + "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe" + + " one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe" + + " two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC" + + " 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC" + + " 2\",\"interconnects\":\"stripe-two\"}}}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueCreateSecret.json + */ + /** + * Sample code: Create or update configuration group value with secrets. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateConfigurationGroupValueWithSecrets( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupValues() + .define("testConfigurationGroupValue") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withProperties( + new ConfigurationValueWithSecrets() + .withConfigurationGroupSchemaResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName")) + .withSecretConfigurationValue("fakeTokenPlaceholder")) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesDeleteSamples.java new file mode 100644 index 000000000000..132d5df3b7ed --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupValues Delete. */ +public final class ConfigurationGroupValuesDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueDelete.json + */ + /** + * Sample code: Delete hybrid configuration group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteHybridConfigurationGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupValues() + .delete("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7edd6a733d6f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupValues GetByResourceGroup. */ +public final class ConfigurationGroupValuesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueGet.json + */ + /** + * Sample code: Get hybrid configuration group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getHybridConfigurationGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .configurationGroupValues() + .getByResourceGroupWithResponse("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b16660dc8274 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupValues ListByResourceGroup. */ +public final class ConfigurationGroupValuesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueListByResourceGroup.json + */ + /** + * Sample code: List all hybrid network configurationGroupValues in a subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllHybridNetworkConfigurationGroupValuesInASubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.configurationGroupValues().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListSamples.java new file mode 100644 index 000000000000..80e3b654c6cd --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for ConfigurationGroupValues List. */ +public final class ConfigurationGroupValuesListSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueListBySubscription.json + */ + /** + * Sample code: List all hybrid network sites in a subscription. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllHybridNetworkSitesInASubscription( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.configurationGroupValues().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesUpdateTagsSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesUpdateTagsSamples.java new file mode 100644 index 000000000000..e1feaee83172 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ConfigurationGroupValuesUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ConfigurationGroupValue; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ConfigurationGroupValues UpdateTags. */ +public final class ConfigurationGroupValuesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/ConfigurationGroupValueUpdateTags.json + */ + /** + * Sample code: Update hybrid configuration group tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateHybridConfigurationGroupTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + ConfigurationGroupValue resource = + manager + .configurationGroupValues() + .getByResourceGroupWithResponse("rg1", "testConfigurationGroupValue", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateSamples.java deleted file mode 100644 index b7d34ef3090e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.management.SubResource; -import com.azure.resourcemanager.hybridnetwork.models.AzureStackEdgeFormat; - -/** Samples for Devices CreateOrUpdate. */ -public final class DevicesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceCreate.json - */ - /** - * Sample code: Create or update device. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void createOrUpdateDevice(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager - .devices() - .define("TestDevice") - .withRegion("eastus") - .withExistingResourceGroup("rg1") - .withProperties( - new AzureStackEdgeFormat() - .withAzureStackEdge( - new SubResource() - .withId( - "/subscriptions/subid1/resourcegroups/rg2/providers/Microsoft.DataboxEdge/DataboxEdgeDevices/TestDataboxEdgeDeviceName"))) - .create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ba1136fcbc4d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsCreateOrUpdateSamples.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.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionGroups CreateOrUpdate. */ +public final class NetworkFunctionDefinitionGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupCreate.json + */ + /** + * Sample code: Create or update the network function definition group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkFunctionDefinitionGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionGroups() + .define("TestNetworkFunctionDefinitionGroupName") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsDeleteSamples.java new file mode 100644 index 000000000000..1c2c0f0c7c10 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionGroups Delete. */ +public final class NetworkFunctionDefinitionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupDelete.json + */ + /** + * Sample code: Delete a network function group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionGroups() + .delete("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsGetSamples.java new file mode 100644 index 000000000000..69a196073c31 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionGroups Get. */ +public final class NetworkFunctionDefinitionGroupsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupGet.json + */ + /** + * Sample code: Get a networkFunctionDefinition group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkFunctionDefinitionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsListByPublisherSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsListByPublisherSamples.java new file mode 100644 index 000000000000..ef31bae7937f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsListByPublisherSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionGroups ListByPublisher. */ +public final class NetworkFunctionDefinitionGroupsListByPublisherSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupsListByPublisherName.json + */ + /** + * Sample code: Get networkFunctionDefinition groups under publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionGroupsUnderPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionGroups() + .listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsUpdateSamples.java new file mode 100644 index 000000000000..0ffd58510a26 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionGroupsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkFunctionDefinitionGroups Update. */ +public final class NetworkFunctionDefinitionGroupsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionGroupUpdateTags.json + */ + /** + * Sample code: Create or update the network function definition group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkFunctionDefinitionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkFunctionDefinitionGroup resource = + manager + .networkFunctionDefinitionGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0e9b53676a95 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsCreateOrUpdateSamples.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ApplicationEnablement; +import com.azure.resourcemanager.hybridnetwork.models.ArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ArmTemplateMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesHelmApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureArcKubernetesNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionArmTemplateApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNetworkFunctionVhdApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreVhdImageDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionArmTemplateApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionImageApplication; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusNetworkFunctionTemplate; +import com.azure.resourcemanager.hybridnetwork.models.ContainerizedNetworkFunctionDefinitionVersion; +import com.azure.resourcemanager.hybridnetwork.models.DependsOnProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmInstallOptions; +import com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.HelmMappingRuleProfileOptions; +import com.azure.resourcemanager.hybridnetwork.models.HelmUpgradeOptions; +import com.azure.resourcemanager.hybridnetwork.models.ImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ImageMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.VhdImageArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.VhdImageMappingRuleProfile; +import com.azure.resourcemanager.hybridnetwork.models.VirtualNetworkFunctionDefinitionVersion; +import java.util.Arrays; + +/** Samples for NetworkFunctionDefinitionVersions CreateOrUpdate. */ +public final class NetworkFunctionDefinitionVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json + */ + /** + * Sample code: Create or update a network function definition version resource for AzureCore VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new VirtualNetworkFunctionDefinitionVersion() + .withDescription("test NFDV for AzureCore") + .withDeployParameters( + "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}") + .withNetworkFunctionTemplate( + new AzureCoreNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureCoreNetworkFunctionVhdApplication() + .withName("testImageRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureCoreVhdImageArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withVhdArtifactProfile( + new VhdImageArtifactProfile() + .withVhdName("test-image") + .withVhdVersion("1-0-0"))) + .withDeployParametersMappingRuleProfile( + new AzureCoreVhdImageDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withVhdImageMappingRuleProfile( + new VhdImageMappingRuleProfile().withUserConfiguration(""))), + new AzureCoreNetworkFunctionArmTemplateApplication() + .withName("testTemplateRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList("testImageRole")) + .withUninstallDependsOn(Arrays.asList("testImageRole")) + .withUpdateDependsOn(Arrays.asList("testImageRole"))) + .withArtifactProfile( + new AzureCoreArmTemplateArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withTemplateArtifactProfile( + new ArmTemplateArtifactProfile() + .withTemplateName("test-template") + .withTemplateVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureCoreArmTemplateDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withTemplateMappingRuleProfile( + new ArmTemplateMappingRuleProfile() + .withTemplateParameters( + "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json + */ + /** + * Sample code: Create or update a network function definition version resource for AzureOperatorNexus VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new VirtualNetworkFunctionDefinitionVersion() + .withDescription("test NFDV for AzureOperatorNexus") + .withDeployParameters( + "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}") + .withNetworkFunctionTemplate( + new AzureOperatorNexusNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureOperatorNexusNetworkFunctionImageApplication() + .withName("testImageRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureOperatorNexusImageArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withImageArtifactProfile( + new ImageArtifactProfile() + .withImageName("test-image") + .withImageVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureOperatorNexusImageDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withImageMappingRuleProfile( + new ImageMappingRuleProfile().withUserConfiguration(""))), + new AzureOperatorNexusNetworkFunctionArmTemplateApplication() + .withName("testTemplateRole") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList("testImageRole")) + .withUninstallDependsOn(Arrays.asList("testImageRole")) + .withUpdateDependsOn(Arrays.asList("testImageRole"))) + .withArtifactProfile( + new AzureOperatorNexusArmTemplateArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore")) + .withTemplateArtifactProfile( + new ArmTemplateArtifactProfile() + .withTemplateName("test-template") + .withTemplateVersion("1.0.0"))) + .withDeployParametersMappingRuleProfile( + new AzureOperatorNexusArmTemplateDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.UNKNOWN) + .withTemplateMappingRuleProfile( + new ArmTemplateMappingRuleProfile() + .withTemplateParameters( + "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionCreate.json + */ + /** + * Sample code: Create or update a network function definition version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateANetworkFunctionDefinitionVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkFunctionDefinitionGroup("rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupName") + .withProperties( + new ContainerizedNetworkFunctionDefinitionVersion() + .withDeployParameters( + "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}") + .withNetworkFunctionTemplate( + new AzureArcKubernetesNetworkFunctionTemplate() + .withNetworkFunctionApplications( + Arrays + .asList( + new AzureArcKubernetesHelmApplication() + .withName("fedrbac") + .withDependsOnProfile( + new DependsOnProfile() + .withInstallDependsOn(Arrays.asList()) + .withUninstallDependsOn(Arrays.asList()) + .withUpdateDependsOn(Arrays.asList())) + .withArtifactProfile( + new AzureArcKubernetesArtifactProfile() + .withArtifactStore( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore")) + .withHelmArtifactProfile( + new HelmArtifactProfile() + .withHelmPackageName("fed-rbac") + .withHelmPackageVersionRange("~2.1.3") + .withRegistryValuesPaths( + Arrays.asList("global.registry.docker.repoPath")) + .withImagePullSecretsValuesPaths( + Arrays.asList("global.imagePullSecrets")))) + .withDeployParametersMappingRuleProfile( + new AzureArcKubernetesDeployMappingRuleProfile() + .withApplicationEnablement(ApplicationEnablement.ENABLED) + .withHelmMappingRuleProfile( + new HelmMappingRuleProfile() + .withReleaseNamespace("{deployParameters.namesapce}") + .withReleaseName("{deployParameters.releaseName}") + .withHelmPackageVersion("2.1.3") + .withValues("") + .withOptions( + new HelmMappingRuleProfileOptions() + .withInstallOptions( + new HelmInstallOptions() + .withAtomic("true") + .withWait("waitValue") + .withTimeout("30")) + .withUpgradeOptions( + new HelmUpgradeOptions() + .withAtomic("true") + .withWait("waitValue") + .withTimeout("30"))))))))) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsDeleteSamples.java new file mode 100644 index 000000000000..dea7747cc0a5 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsDeleteSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionVersions Delete. */ +public final class NetworkFunctionDefinitionVersionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersion( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version for AzureOperatorNexus VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json + */ + /** + * Sample code: Delete a network function definition version for AzureCore VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionDefinitionVersionForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsGetSamples.java new file mode 100644 index 000000000000..4da3f98fbb8b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsGetSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionVersions Get. */ +public final class NetworkFunctionDefinitionVersionsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get a network function definition version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkFunctionDefinitionVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get network function definition version resource for AzureCore VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json + */ + /** + * Sample code: Get network function definition version resource for AzureOperatorNexus VNF. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSamples.java new file mode 100644 index 000000000000..91e926233d0a --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkFunctionDefinitionVersions ListByNetworkFunctionDefinitionGroup. */ +public final class NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json + */ + /** + * Sample code: Get Publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .listByNetworkFunctionDefinitionGroup( + "rg", "TestPublisher", "TestNetworkFunctionDefinitionGroupNameName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateSamples.java new file mode 100644 index 000000000000..6fe34dfee896 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionDefinitionVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkFunctionDefinitionVersions Update. */ +public final class NetworkFunctionDefinitionVersionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionUpdateTags.json + */ + /** + * Sample code: Update the network function definition version tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateTheNetworkFunctionDefinitionVersionTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkFunctionDefinitionVersion resource = + manager + .networkFunctionDefinitionVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateStateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateStateSamples.java new file mode 100644 index 000000000000..e4290c0fa27d --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionDefinitionVersionsUpdateStateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionDefinitionVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +/** Samples for NetworkFunctionDefinitionVersions UpdateState. */ +public final class NetworkFunctionDefinitionVersionsUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDefinitionVersionUpdateState.json + */ + /** + * Sample code: Update network function definition version state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkFunctionDefinitionVersionState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctionDefinitionVersions() + .updateState( + "rg", + "TestPublisher", + "TestSkuGroup", + "1.0.0", + new NetworkFunctionDefinitionVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorSamples.java deleted file mode 100644 index d43f07927d03..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for NetworkFunctionVendorSkus ListByVendor. */ -public final class NetworkFunctionVendorSkusListByVendorSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuListByVendor.json - */ - /** - * Sample code: List vendors and skus. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void listVendorsAndSkus(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendorSkus().listByVendor("testVendor", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListSamples.java deleted file mode 100644 index 4207678f39d6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for NetworkFunctionVendors List. */ -public final class NetworkFunctionVendorsListSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionVendorAndSkuListBySubscription.json - */ - /** - * Sample code: List vendors and skus. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void listVendorsAndSkus(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctionVendors().list(Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsCreateOrUpdateSamples.java index 510d6f35dc15..2cbaaea8362e 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsCreateOrUpdateSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsCreateOrUpdateSamples.java @@ -4,22 +4,81 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.management.SubResource; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.io.IOException; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithSecrets; +import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionValueWithoutSecrets; +import com.azure.resourcemanager.hybridnetwork.models.NfviType; +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; import java.util.Arrays; /** Samples for NetworkFunctions CreateOrUpdate. */ public final class NetworkFunctionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionCreate.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionCreate.json + */ + /** + * Sample code: Create virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_CORE) + .withNfviId("/subscriptions/subid/resourceGroups/testResourceGroup") + .withAllowSoftwareUpdate(false) + .withDeploymentValues( + "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa" + + " CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionFirstPartyCreate.json + */ + /** + * Sample code: Create first party network function resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createFirstPartyNetworkFunctionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withDeploymentValues("{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionCreate.json */ /** * Sample code: Create network function resource. @@ -27,60 +86,93 @@ public final class NetworkFunctionsCreateOrUpdateSamples { * @param manager Entry point to HybridNetworkManager. */ public static void createNetworkFunctionResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) throws IOException { + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withDeploymentValues("{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionCreateSecret.json + */ + /** + * Sample code: Create network function resource with secrets. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createNetworkFunctionResourceWithSecrets( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .define("testNf") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties( + new NetworkFunctionValueWithSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_ARC_KUBERNETES) + .withNfviId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withRoleOverrideValues( + Arrays + .asList( + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}")) + .withSecretDeploymentValues("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionCreate.json + */ + /** + * Sample code: Create virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager .networkFunctions() .define("testNf") .withRegion("eastus") .withExistingResourceGroup("rg") - .withDevice( - new SubResource() - .withId( - "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/devices/testDevice")) - .withSkuName("testSku") - .withVendorName("testVendor") - .withManagedApplicationParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkFunctionUserConfigurations( - Arrays - .asList( - new NetworkFunctionUserConfiguration() - .withRoleName("testRole") - .withUserDataParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("DC-97-F8-79-16-7D") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN))))) + .withProperties( + new NetworkFunctionValueWithoutSecrets() + .withNetworkFunctionDefinitionVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1")) + .withNfviType(NfviType.AZURE_OPERATOR_NEXUS) + .withNfviId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation") + .withAllowSoftwareUpdate(false) + .withDeploymentValues( + "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa" + + " CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}")) .create(); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteSamples.java index 617b13029282..3fc8cf3beb78 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - /** Samples for NetworkFunctions Delete. */ public final class NetworkFunctionsDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionDelete.json */ /** * Sample code: Delete network function resource. @@ -18,6 +16,32 @@ public final class NetworkFunctionsDeleteSamples { */ public static void deleteNetworkFunctionResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().delete("rg", "testNf", Context.NONE); + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionDelete.json + */ + /** + * Sample code: Delete virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionDelete.json + */ + /** + * Sample code: Delete virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().delete("rg", "testNf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsExecuteRequestSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsExecuteRequestSamples.java new file mode 100644 index 000000000000..750e1901d2ed --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsExecuteRequestSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ExecuteRequestParameters; +import com.azure.resourcemanager.hybridnetwork.models.HttpMethod; +import com.azure.resourcemanager.hybridnetwork.models.RequestMetadata; + +/** Samples for NetworkFunctions ExecuteRequest. */ +public final class NetworkFunctionsExecuteRequestSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionsExecuteRequest.json + */ + /** + * Sample code: Send request to network function services. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void sendRequestToNetworkFunctionServices( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkFunctions() + .executeRequest( + "rg", + "testNetworkfunction", + new ExecuteRequestParameters() + .withServiceEndpoint("serviceEndpoint") + .withRequestMetadata( + new RequestMetadata() + .withRelativePath("/simProfiles/testSimProfile") + .withHttpMethod(HttpMethod.POST) + .withSerializedBody( + "{\"subscriptionProfile\":\"ChantestSubscription15\",\"permanentKey\":\"00112233445566778899AABBCCDDEEFF\",\"opcOperatorCode\":\"63bfa50ee6523365ff14c1f45f88737d\",\"staticIpAddresses\":{\"internet\":{\"ipv4Addr\":\"198.51.100.1\",\"ipv6Prefix\":\"2001:db8:abcd:12::0/64\"},\"another_network\":{\"ipv6Prefix\":\"2001:111:cdef:22::0/64\"}}}") + .withApiVersion("apiVersionQueryString")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsGetByResourceGroupSamples.java index 333da9929726..f7104c8b51fc 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsGetByResourceGroupSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsGetByResourceGroupSamples.java @@ -4,12 +4,23 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - /** Samples for NetworkFunctions GetByResourceGroup. */ public final class NetworkFunctionsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureOperatorNexus/VirtualNetworkFunctionGet.json + */ + /** + * Sample code: Get virtual network function resource on AzureOperatorNexus. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getVirtualNetworkFunctionResourceOnAzureOperatorNexus( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionGet.json */ /** * Sample code: Get network function resource. @@ -18,6 +29,19 @@ public final class NetworkFunctionsGetByResourceGroupSamples { */ public static void getNetworkFunctionResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", Context.NONE); + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/AzureCore/VirtualNetworkFunctionGet.json + */ + /** + * Sample code: Get virtual network function resource on AzureCore. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getVirtualNetworkFunctionResourceOnAzureCore( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListByResourceGroupSamples.java index 25831e40ca60..ed9ec89c6b1b 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListByResourceGroupSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - /** Samples for NetworkFunctions ListByResourceGroup. */ public final class NetworkFunctionsListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListByResourceGroup.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionListByResourceGroup.json */ /** * Sample code: List network function in resource group. @@ -18,6 +16,6 @@ public final class NetworkFunctionsListByResourceGroupSamples { */ public static void listNetworkFunctionInResourceGroup( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().listByResourceGroup("rg", Context.NONE); + manager.networkFunctions().listByResourceGroup("rg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListSamples.java index d01d3008dc1d..c160939a6ad8 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - /** Samples for NetworkFunctions List. */ public final class NetworkFunctionsListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionListBySubscription.json */ /** * Sample code: List all network function resources in subscription. @@ -18,6 +16,6 @@ public final class NetworkFunctionsListSamples { */ public static void listAllNetworkFunctionResourcesInSubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.networkFunctions().list(Context.NONE); + manager.networkFunctions().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsUpdateTagsSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsUpdateTagsSamples.java index 6ac69bb61e46..3c17d6919849 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsUpdateTagsSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsUpdateTagsSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.hybridnetwork.models.NetworkFunction; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for NetworkFunctions UpdateTags. */ public final class NetworkFunctionsUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionUpdateTags.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkFunctionUpdateTags.json */ /** * Sample code: Update tags for network function resource. @@ -22,10 +21,14 @@ public final class NetworkFunctionsUpdateTagsSamples { public static void updateTagsForNetworkFunctionResource( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { NetworkFunction resource = - manager.networkFunctions().getByResourceGroupWithResponse("rg", "testNf", Context.NONE).getValue(); + manager + .networkFunctions() + .getByResourceGroupWithResponse("rg", "testNf", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2f1a94e300a6 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsCreateOrUpdateSamples.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.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignGroups CreateOrUpdate. */ +public final class NetworkServiceDesignGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupCreate.json + */ + /** + * Sample code: Create or update the network service design group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkServiceDesignGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .define("TestNetworkServiceDesignGroupName") + .withRegion("eastus") + .withExistingPublisher("rg", "TestPublisher") + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsDeleteSamples.java new file mode 100644 index 000000000000..c98dc80d6c05 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignGroups Delete. */ +public final class NetworkServiceDesignGroupsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupDelete.json + */ + /** + * Sample code: Delete a network function group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkFunctionGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .delete("rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsGetSamples.java new file mode 100644 index 000000000000..b1c1c3851464 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignGroups Get. */ +public final class NetworkServiceDesignGroupsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupGet.json + */ + /** + * Sample code: Get a networkServiceDesign group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkServiceDesignGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsListByPublisherSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsListByPublisherSamples.java new file mode 100644 index 000000000000..acda99077b7f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsListByPublisherSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignGroups ListByPublisher. */ +public final class NetworkServiceDesignGroupsListByPublisherSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupsListByPublisherName.json + */ + /** + * Sample code: Get networkServiceDesign groups under publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkServiceDesignGroupsUnderPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.networkServiceDesignGroups().listByPublisher("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsUpdateSamples.java new file mode 100644 index 000000000000..576f2704a234 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignGroupsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignGroups Update. */ +public final class NetworkServiceDesignGroupsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignGroupUpdateTags.json + */ + /** + * Sample code: Create or update the network service design group resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateTheNetworkServiceDesignGroupResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkServiceDesignGroup resource = + manager + .networkServiceDesignGroups() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..caa08683d027 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsCreateOrUpdateSamples.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.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplate; +import com.azure.resourcemanager.hybridnetwork.models.ArmResourceDefinitionResourceElementTemplateDetails; +import com.azure.resourcemanager.hybridnetwork.models.DependsOnProfile; +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersionPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.NsdArtifactProfile; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.TemplateType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignVersions CreateOrUpdate. */ +public final class NetworkServiceDesignVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionCreate.json + */ + /** + * Sample code: Create or update a network service design version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateANetworkServiceDesignVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .define("1.0.0") + .withRegion("eastus") + .withExistingNetworkServiceDesignGroup("rg", "TestPublisher", "TestNetworkServiceDesignGroupName") + .withProperties( + new NetworkServiceDesignVersionPropertiesFormat() + .withConfigurationGroupSchemaReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema"))) + .withResourceElementTemplates( + Arrays + .asList( + new ArmResourceDefinitionResourceElementTemplateDetails() + .withName("MyVM") + .withDependsOnProfile(new DependsOnProfile().withInstallDependsOn(Arrays.asList())) + .withConfiguration( + new ArmResourceDefinitionResourceElementTemplate() + .withTemplateType(TemplateType.ARM_TEMPLATE) + .withParameterValues( + "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}") + .withArtifactProfile( + new NsdArtifactProfile() + .withArtifactStoreReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1")) + .withArtifactName("MyVMArmTemplate") + .withArtifactVersion("1.0.0")))))) + .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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsDeleteSamples.java new file mode 100644 index 000000000000..04ceb5371ba0 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignVersions Delete. */ +public final class NetworkServiceDesignVersionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionDelete.json + */ + /** + * Sample code: Delete a network service design version. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void deleteANetworkServiceDesignVersion( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .delete( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", "1.0.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsGetSamples.java new file mode 100644 index 000000000000..bd9dd2ffc01e --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignVersions Get. */ +public final class NetworkServiceDesignVersionsGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionGet.json + */ + /** + * Sample code: Get a network service design version resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getANetworkServiceDesignVersionResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .getWithResponse( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", "1.0.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsListByNetworkServiceDesignGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsListByNetworkServiceDesignGroupSamples.java new file mode 100644 index 000000000000..3508068a1715 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsListByNetworkServiceDesignGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for NetworkServiceDesignVersions ListByNetworkServiceDesignGroup. */ +public final class NetworkServiceDesignVersionsListByNetworkServiceDesignGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json + */ + /** + * Sample code: Get Publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .listByNetworkServiceDesignGroup( + "rg", "TestPublisher", "TestNetworkServiceDesignGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateSamples.java new file mode 100644 index 000000000000..2b213aea33c1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.NetworkServiceDesignVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkServiceDesignVersions Update. */ +public final class NetworkServiceDesignVersionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionUpdateTags.json + */ + /** + * Sample code: Update the network service design version tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateTheNetworkServiceDesignVersionTags( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + NetworkServiceDesignVersion resource = + manager + .networkServiceDesignVersions() + .getWithResponse( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateStateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateStateSamples.java new file mode 100644 index 000000000000..8dc783a34603 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkServiceDesignVersionsUpdateStateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkServiceDesignVersionUpdateStateInner; +import com.azure.resourcemanager.hybridnetwork.models.VersionState; + +/** Samples for NetworkServiceDesignVersions UpdateState. */ +public final class NetworkServiceDesignVersionsUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/NetworkServiceDesignVersionUpdateState.json + */ + /** + * Sample code: Update network service design version state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkServiceDesignVersionState( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .networkServiceDesignVersions() + .updateState( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + new NetworkServiceDesignVersionUpdateStateInner().withVersionState(VersionState.ACTIVE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListSamples.java index 3691be9f5ec8..1cc6259b36e2 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/GetOperations.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/GetOperations.json */ /** * Sample code: Get Registration Operations. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to HybridNetworkManager. */ public static void getRegistrationOperations(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactGetSamples.java new file mode 100644 index 000000000000..8068a62c814c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactGetSamples.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.hybridnetwork.generated; + +/** Samples for ProxyArtifact Get. */ +public final class ProxyArtifactGetSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactGet.json + */ + /** + * Sample code: Get an artifact overview. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getAnArtifactOverview(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .proxyArtifacts() + .get( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactListSamples.java similarity index 50% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactListSamples.java index 897ce6e5ba0f..b3f676cbf569 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactListSamples.java @@ -4,20 +4,20 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for RoleInstances List. */ -public final class RoleInstancesListSamples { +/** Samples for ProxyArtifact List. */ +public final class ProxyArtifactListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceListByVendorNetworkFunction.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactList.json */ /** - * Sample code: List all role instances of vendor network function. + * Sample code: List artifacts under an artifact store. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllRoleInstancesOfVendorNetworkFunction( + public static void listArtifactsUnderAnArtifactStore( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().list("eastus", "testVendor", "testServiceKey", Context.NONE); + manager + .proxyArtifacts() + .list("TestResourceGroup", "TestPublisher", "TestArtifactStoreName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactUpdateStateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactUpdateStateSamples.java new file mode 100644 index 000000000000..62f30a70eba1 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/ProxyArtifactUpdateStateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeState; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactChangeStateProperties; +import com.azure.resourcemanager.hybridnetwork.models.ArtifactState; + +/** Samples for ProxyArtifact UpdateState. */ +public final class ProxyArtifactUpdateStateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PureProxyArtifact/ArtifactChangeState.json + */ + /** + * Sample code: Update an artifact state. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateAnArtifactState(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .proxyArtifacts() + .updateState( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + "1.0.0", + new ArtifactChangeState() + .withProperties(new ArtifactChangeStateProperties().withArtifactState(ArtifactState.DEPRECATED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..74da57b9d243 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.PublisherPropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.PublisherScope; + +/** Samples for Publishers CreateOrUpdate. */ +public final class PublishersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherCreate.json + */ + /** + * Sample code: Create or update a publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createOrUpdateAPublisherResource( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .publishers() + .define("TestPublisher") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withProperties(new PublisherPropertiesFormat().withScope(PublisherScope.fromString("Public"))) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListRegistrationKeySamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersDeleteSamples.java similarity index 50% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListRegistrationKeySamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersDeleteSamples.java index 816a283f5c39..f119716cd02f 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListRegistrationKeySamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersDeleteSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Devices ListRegistrationKey. */ -public final class DevicesListRegistrationKeySamples { +/** Samples for Publishers Delete. */ +public final class PublishersDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListRegistrationKey.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherDelete.json */ /** - * Sample code: Get device registration key. + * Sample code: Delete a publisher resource. * * @param manager Entry point to HybridNetworkManager. */ - public static void getDeviceRegistrationKey(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().listRegistrationKeyWithResponse("rg1", "TestDevice", Context.NONE); + public static void deleteAPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().delete("rg", "TestPublisher", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..dd06a45460a7 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for Publishers GetByResourceGroup. */ +public final class PublishersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherGet.json + */ + /** + * Sample code: Get a publisher resource. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getAPublisherResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().getByResourceGroupWithResponse("rg", "TestPublisher", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListByResourceGroupSamples.java new file mode 100644 index 000000000000..acb2de19931f --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for Publishers ListByResourceGroup. */ +public final class PublishersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherListByResourceGroup.json + */ + /** + * Sample code: List all publisher resources in a resource group. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllPublisherResourcesInAResourceGroup( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.publishers().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListSamples.java similarity index 55% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListSamples.java index 6462cb19b6c2..ddb81a3955e4 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Vendors List. */ -public final class VendorsListSamples { +/** Samples for Publishers List. */ +public final class PublishersListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherListBySubscription.json */ /** - * Sample code: List all vendor resources in subscription. + * Sample code: List all publisher resources in a subscription. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllVendorResourcesInSubscription( + public static void listAllPublisherResourcesInASubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().list(Context.NONE); + manager.publishers().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersUpdateSamples.java new file mode 100644 index 000000000000..4a591cc167cc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/PublishersUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.Publisher; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Publishers Update. */ +public final class PublishersUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/PublisherUpdateTags.json + */ + /** + * Sample code: Update a publisher tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateAPublisherTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + Publisher resource = + manager + .publishers() + .getByResourceGroupWithResponse("rg", "TestPublisher", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesGetSamples.java deleted file mode 100644 index e6208b4a4dbc..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for RoleInstances Get. */ -public final class RoleInstancesGetSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceGet.json - */ - /** - * Sample code: Get the operational state of role instance of vendor network function. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void getTheOperationalStateOfRoleInstanceOfVendorNetworkFunction( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().getWithResponse("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartSamples.java deleted file mode 100644 index 387f9de98bc2..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for RoleInstances Restart. */ -public final class RoleInstancesRestartSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceRestart.json - */ - /** - * Sample code: Restart a role instance of a vendor network function. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void restartARoleInstanceOfAVendorNetworkFunction( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().restart("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartSamples.java deleted file mode 100644 index b47383b5b2eb..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for RoleInstances Start. */ -public final class RoleInstancesStartSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStart.json - */ - /** - * Sample code: Start a role instance of a vendor network function. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void startARoleInstanceOfAVendorNetworkFunction( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().start("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopSamples.java deleted file mode 100644 index 13cfaea5cc88..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for RoleInstances Stop. */ -public final class RoleInstancesStopSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStop.json - */ - /** - * Sample code: Stop a role instance of a vendor network function. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void stopARoleInstanceOfAVendorNetworkFunction( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.roleInstances().stop("eastus", "testVendor", "testServiceKey", "mrm", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..07bb54657e74 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesCreateOrUpdateSamples.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.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.OpenDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.SecretDeploymentResourceReference; +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkServicePropertiesFormat; +import com.azure.resourcemanager.hybridnetwork.models.Sku; +import com.azure.resourcemanager.hybridnetwork.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SiteNetworkServices CreateOrUpdate. */ +public final class SiteNetworkServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceCreate.json + */ + /** + * Sample code: Create site network service. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createSiteNetworkService(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .define("testSiteNetworkServiceName") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SiteNetworkServicePropertiesFormat() + .withSiteReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite")) + .withNetworkServiceDesignVersionResourceReference( + new OpenDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0")) + .withDesiredStateConfigurationGroupValueReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1")))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceFirstPartyCreate.json + */ + /** + * Sample code: Create first party site network service. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createFirstPartySiteNetworkService( + com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .define("testSiteNetworkServiceName") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SiteNetworkServicePropertiesFormat() + .withSiteReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite")) + .withNetworkServiceDesignVersionResourceReference( + new SecretDeploymentResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0")) + .withDesiredStateConfigurationGroupValueReferences( + mapOf( + "MyVM_Configuration", + new ReferencedResource() + .withId( + "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1")))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesDeleteSamples.java similarity index 51% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesGetByResourceGroupSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesDeleteSamples.java index ee8de0fdb060..fc9b31713048 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesGetByResourceGroupSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesDeleteSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Devices GetByResourceGroup. */ -public final class DevicesGetByResourceGroupSamples { +/** Samples for SiteNetworkServices Delete. */ +public final class SiteNetworkServicesDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceDelete.json */ /** - * Sample code: Get device resource. + * Sample code: Delete network site. * * @param manager Entry point to HybridNetworkManager. */ - public static void getDeviceResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().getByResourceGroupWithResponse("rg1", "TestDevice", Context.NONE); + public static void deleteNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.siteNetworkServices().delete("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3d9970be750b --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for SiteNetworkServices GetByResourceGroup. */ +public final class SiteNetworkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceGet.json + */ + /** + * Sample code: Get network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .siteNetworkServices() + .getByResourceGroupWithResponse("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b2b0ffa32d8c --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for SiteNetworkServices ListByResourceGroup. */ +public final class SiteNetworkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceListByResourceGroup.json + */ + /** + * Sample code: List all network sites. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllNetworkSites(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.siteNetworkServices().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListSamples.java similarity index 53% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListSamples.java index 2c5264b85afc..18b320242d52 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for VendorSkus Delete. */ -public final class VendorSkusDeleteSamples { +/** Samples for SiteNetworkServices List. */ +public final class SiteNetworkServicesListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuDelete.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceListBySubscription.json */ /** - * Sample code: Delete the sku of vendor resource. + * Sample code: List all hybrid network sites in a subscription. * * @param manager Entry point to HybridNetworkManager. */ - public static void deleteTheSkuOfVendorResource( + public static void listAllHybridNetworkSitesInASubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().delete("TestVendor", "TestSku", Context.NONE); + manager.siteNetworkServices().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesUpdateTagsSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesUpdateTagsSamples.java new file mode 100644 index 000000000000..3c3c394f05dc --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SiteNetworkServicesUpdateTagsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.SiteNetworkService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SiteNetworkServices UpdateTags. */ +public final class SiteNetworkServicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteNetworkServiceUpdateTags.json + */ + /** + * Sample code: Update network site tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkSiteTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + SiteNetworkService resource = + manager + .siteNetworkServices() + .getByResourceGroupWithResponse("rg1", "testSiteNetworkServiceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4716c12eb271 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.AzureArcK8SClusterNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.AzureCoreNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.AzureOperatorNexusClusterNfviDetails; +import com.azure.resourcemanager.hybridnetwork.models.ReferencedResource; +import com.azure.resourcemanager.hybridnetwork.models.SitePropertiesFormat; +import java.util.Arrays; + +/** Samples for Sites CreateOrUpdate. */ +public final class SitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteCreate.json + */ + /** + * Sample code: Create network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void createNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager + .sites() + .define("testSite") + .withRegion("westUs2") + .withExistingResourceGroup("rg1") + .withProperties( + new SitePropertiesFormat() + .withNfvis( + Arrays + .asList( + new AzureCoreNfviDetails().withName("nfvi1").withLocation("westUs2"), + new AzureArcK8SClusterNfviDetails() + .withName("nfvi2") + .withCustomLocationReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1")), + new AzureOperatorNexusClusterNfviDetails() + .withName("nfvi3") + .withCustomLocationReference( + new ReferencedResource() + .withId( + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2"))))) + .create(); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesDeleteSamples.java similarity index 54% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsGetSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesDeleteSamples.java index 6e49741c03ab..0567c45c861d 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsGetSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesDeleteSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Vendors Get. */ -public final class VendorsGetSamples { +/** Samples for Sites Delete. */ +public final class SitesDeleteSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorGet.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteDelete.json */ /** - * Sample code: Get Vendor resource. + * Sample code: Delete network site. * * @param manager Entry point to HybridNetworkManager. */ - public static void getVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().getWithResponse("TestVendor", Context.NONE); + public static void deleteNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().delete("rg1", "testSite", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesGetByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..a10086ed0b86 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for Sites GetByResourceGroup. */ +public final class SitesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteGet.json + */ + /** + * Sample code: Get network site. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void getNetworkSite(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().getByResourceGroupWithResponse("rg1", "testSite", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListByResourceGroupSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListByResourceGroupSamples.java new file mode 100644 index 000000000000..938a7c2101aa --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +/** Samples for Sites ListByResourceGroup. */ +public final class SitesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteListByResourceGroup.json + */ + /** + * Sample code: List all network sites. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void listAllNetworkSites(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + manager.sites().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListSamples.java similarity index 56% rename from sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListSamples.java rename to sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListSamples.java index 22a16ca66c29..0ac51b95d3f1 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListSamples.java +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesListSamples.java @@ -4,20 +4,18 @@ package com.azure.resourcemanager.hybridnetwork.generated; -import com.azure.core.util.Context; - -/** Samples for Devices List. */ -public final class DevicesListSamples { +/** Samples for Sites List. */ +public final class SitesListSamples { /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListBySubscription.json + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteListBySubscription.json */ /** - * Sample code: List all devices in a subscription. + * Sample code: List all hybrid network sites in a subscription. * * @param manager Entry point to HybridNetworkManager. */ - public static void listAllDevicesInASubscription( + public static void listAllHybridNetworkSitesInASubscription( com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.devices().list(Context.NONE); + manager.sites().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesUpdateTagsSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesUpdateTagsSamples.java new file mode 100644 index 000000000000..401fd1c6c818 --- /dev/null +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/SitesUpdateTagsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridnetwork.generated; + +import com.azure.resourcemanager.hybridnetwork.models.Site; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sites UpdateTags. */ +public final class SitesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2023-09-01/examples/SiteUpdateTags.json + */ + /** + * Sample code: Update network site tags. + * + * @param manager Entry point to HybridNetworkManager. + */ + public static void updateNetworkSiteTags(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { + Site resource = + manager + .sites() + .getByResourceGroupWithResponse("rg1", "testSite", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateSamples.java deleted file mode 100644 index ab22ade8013e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateSamples.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.SshConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.SshPublicKey; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Arrays; - -/** Samples for VendorNetworkFunctions CreateOrUpdate. */ -public final class VendorNetworkFunctionsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfCreate.json - */ - /** - * Sample code: Create or update vendor network function sub resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void createOrUpdateVendorNetworkFunctionSubResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager - .vendorNetworkFunctions() - .define("testServiceKey") - .withExistingVendor("eastus", "testVendor") - .withVendorProvisioningState(VendorProvisioningState.PROVISIONING) - .withNetworkFunctionVendorConfigurations( - Arrays - .asList( - new NetworkFunctionVendorConfiguration() - .withRoleName("testRole") - .withOsProfile( - new OsProfile() - .withAdminUsername("dummyuser") - .withLinuxConfiguration( - new LinuxConfiguration() - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withPath("home/user/.ssh/authorized_keys") - .withKeyData( - "ssh-rsa" - + " AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS=" - + " user@constoso-DSH"))))) - .withCustomData("base-64 encoded string of custom data")) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("DC-97-F8-79-16-7D") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN))))) - .create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsGetSamples.java deleted file mode 100644 index 8649b018dd9d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for VendorNetworkFunctions Get. */ -public final class VendorNetworkFunctionsGetSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfGet.json - */ - /** - * Sample code: Get vendor network function sub resource by service key of network function. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void getVendorNetworkFunctionSubResourceByServiceKeyOfNetworkFunction( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorNetworkFunctions().getWithResponse("eastus", "testVendor", "testServiceKey", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewCreateOrUpdateSamples.java deleted file mode 100644 index bc807a2c8e87..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewCreateOrUpdateSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -/** Samples for VendorSkuPreview CreateOrUpdate. */ -public final class VendorSkuPreviewCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewCreate.json - */ - /** - * Sample code: Create or update preview subscription of vendor sku sub resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void createOrUpdatePreviewSubscriptionOfVendorSkuSubResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().define("previewSub").withExistingVendorSku("TestVendor", "TestSku").create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewDeleteSamples.java deleted file mode 100644 index 051b5801101d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for VendorSkuPreview Delete. */ -public final class VendorSkuPreviewDeleteSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewDelete.json - */ - /** - * Sample code: Delete preview subscription of vendor sku sub resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void deletePreviewSubscriptionOfVendorSkuSubResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().delete("TestVendor", "TestSku", "previewSub", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewGetSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewGetSamples.java deleted file mode 100644 index 7940010931ae..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for VendorSkuPreview Get. */ -public final class VendorSkuPreviewGetSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewGet.json - */ - /** - * Sample code: Get preview subscription of vendor sku sub resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void getPreviewSubscriptionOfVendorSkuSubResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().getWithResponse("TestVendor", "TestSku", "previewSub", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewListSamples.java deleted file mode 100644 index a360dee0e4f9..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for VendorSkuPreview List. */ -public final class VendorSkuPreviewListSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewListBySku.json - */ - /** - * Sample code: List all preview subscriptions of vendor sku sub resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void listAllPreviewSubscriptionsOfVendorSkuSubResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkuPreviews().list("TestVendor", "TestSku", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateSamples.java deleted file mode 100644 index c47da9c48e43..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateSamples.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridnetwork.models.CustomProfile; -import com.azure.resourcemanager.hybridnetwork.models.DataDisk; -import com.azure.resourcemanager.hybridnetwork.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.hybridnetwork.models.ImageReference; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfigurationType; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes; -import com.azure.resourcemanager.hybridnetwork.models.OsDisk; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SshConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.SshPublicKey; -import com.azure.resourcemanager.hybridnetwork.models.StorageProfile; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk; -import com.azure.resourcemanager.hybridnetwork.models.VirtualMachineSizeTypes; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for VendorSkus CreateOrUpdate. */ -public final class VendorSkusCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuCreate.json - */ - /** - * Sample code: Create or update the sku of vendor resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void createOrUpdateTheSkuOfVendorResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) throws IOException { - manager - .vendorSkus() - .define("TestSku") - .withExistingVendor("TestVendor") - .withDeploymentMode(SkuDeploymentMode.PRIVATE_EDGE_ZONE) - .withPreview(true) - .withManagedApplicationTemplate( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)) - .withNetworkFunctionTemplate( - new NetworkFunctionTemplate() - .withNetworkFunctionRoleConfigurations( - Arrays - .asList( - new NetworkFunctionRoleConfiguration() - .withRoleName("test") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D3_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("dummyuser") - .withLinuxConfiguration( - new LinuxConfiguration() - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withPath("home/user/.ssh/authorized_keys") - .withKeyData( - "ssh-rsa" - + " AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS=" - + " user@constoso-DSH"))))) - .withCustomData("base-64 encoded string of custom data")) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("nic1") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.WAN), - new NetworkInterface() - .withNetworkInterfaceName("nic2") - .withMacAddress("") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("") - .withSubnet("") - .withGateway("") - .withIpVersion(IpVersion.IPV4))) - .withVmSwitchType(VMSwitchType.MANAGEMENT))) - .withStorageProfile( - new StorageProfile() - .withImageReference( - new ImageReference() - .withPublisher("Canonical") - .withOffer("UbuntuServer") - .withSku("18.04-LTS") - .withVersion("18.04.201804262")) - .withOsDisk( - new OsDisk() - .withOsType(OperatingSystemTypes.LINUX) - .withName("vhdName") - .withVhd( - new VirtualHardDisk() - .withUri( - "https://contoso.net/link/vnd.vhd?sp=rl&st=2020-10-08T20:38:19Z&se=2020-12-09T19:38:00Z&sv=2019-12-12&sr=b&sig=7BM2f4yOw%3D")) - .withDiskSizeGB(30)) - .withDataDisks( - Arrays - .asList( - new DataDisk() - .withCreateOption(DiskCreateOptionTypes.EMPTY) - .withName("DataDisk1") - .withDiskSizeGB(10)))) - .withCustomProfile( - new CustomProfile().withMetadataConfigurationPath("/var/logs/network.cfg"))))) - .create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListSamples.java deleted file mode 100644 index 9c061018770a..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for VendorSkus List. */ -public final class VendorSkusListSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuListByVendor.json - */ - /** - * Sample code: List all the vendor skus of vendor resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void listAllTheVendorSkusOfVendorResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendorSkus().list("TestVendor", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateSamples.java deleted file mode 100644 index 05f3df3aca73..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -/** Samples for Vendors CreateOrUpdate. */ -public final class VendorsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorCreate.json - */ - /** - * Sample code: Create or update Vendor resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void createOrUpdateVendorResource( - com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().define("TestVendor").create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteSamples.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteSamples.java deleted file mode 100644 index 64f40249bd65..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.Context; - -/** Samples for Vendors Delete. */ -public final class VendorsDeleteSamples { - /* - * x-ms-original-file: specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorDelete.json - */ - /** - * Sample code: Delete vendor resource. - * - * @param manager Entry point to HybridNetworkManager. - */ - public static void deleteVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { - manager.vendors().delete("TestVendor", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/AzureStackEdgeFormatTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/AzureStackEdgeFormatTests.java deleted file mode 100644 index f534573421f8..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/AzureStackEdgeFormatTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.management.SubResource; -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.AzureStackEdgeFormat; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureStackEdgeFormatTests { - @Test - public void testDeserialize() { - AzureStackEdgeFormat model = - BinaryData - .fromString( - "{\"deviceType\":\"AzureStackEdge\",\"azureStackEdge\":{\"id\":\"avxbniwdjswztsdb\"},\"status\":\"NotRegistered\",\"provisioningState\":\"Failed\",\"networkFunctions\":[{\"id\":\"pzxbz\"}]}") - .toObject(AzureStackEdgeFormat.class); - Assertions.assertEquals("avxbniwdjswztsdb", model.azureStackEdge().id()); - } - - @Test - public void testSerialize() { - AzureStackEdgeFormat model = - new AzureStackEdgeFormat().withAzureStackEdge(new SubResource().withId("avxbniwdjswztsdb")); - model = BinaryData.fromObject(model).toObject(AzureStackEdgeFormat.class); - Assertions.assertEquals("avxbniwdjswztsdb", model.azureStackEdge().id()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/CustomProfileTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/CustomProfileTests.java deleted file mode 100644 index 3e29a0a3b3ce..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/CustomProfileTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.CustomProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomProfileTests { - @Test - public void testDeserialize() { - CustomProfile model = - BinaryData.fromString("{\"metadataConfigurationPath\":\"gwdkcglhsl\"}").toObject(CustomProfile.class); - Assertions.assertEquals("gwdkcglhsl", model.metadataConfigurationPath()); - } - - @Test - public void testSerialize() { - CustomProfile model = new CustomProfile().withMetadataConfigurationPath("gwdkcglhsl"); - model = BinaryData.fromObject(model).toObject(CustomProfile.class); - Assertions.assertEquals("gwdkcglhsl", model.metadataConfigurationPath()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DataDiskTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DataDiskTests.java deleted file mode 100644 index a5395b44bb0b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DataDiskTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.DataDisk; -import com.azure.resourcemanager.hybridnetwork.models.DiskCreateOptionTypes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DataDiskTests { - @Test - public void testDeserialize() { - DataDisk model = - BinaryData - .fromString("{\"createOption\":\"Unknown\",\"name\":\"dnvowg\",\"diskSizeGB\":884625398}") - .toObject(DataDisk.class); - Assertions.assertEquals(DiskCreateOptionTypes.UNKNOWN, model.createOption()); - Assertions.assertEquals("dnvowg", model.name()); - Assertions.assertEquals(884625398, model.diskSizeGB()); - } - - @Test - public void testSerialize() { - DataDisk model = - new DataDisk().withCreateOption(DiskCreateOptionTypes.UNKNOWN).withName("dnvowg").withDiskSizeGB(884625398); - model = BinaryData.fromObject(model).toObject(DataDisk.class); - Assertions.assertEquals(DiskCreateOptionTypes.UNKNOWN, model.createOption()); - Assertions.assertEquals("dnvowg", model.name()); - Assertions.assertEquals(884625398, model.diskSizeGB()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceInnerTests.java deleted file mode 100644 index dfe14824e0c0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeviceInnerTests { - @Test - public void testDeserialize() { - DeviceInner model = - BinaryData - .fromString( - "{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Registered\",\"provisioningState\":\"Canceled\",\"networkFunctions\":[{\"id\":\"oxzjnchgejspod\"},{\"id\":\"ilzyd\"},{\"id\":\"o\"}]},\"location\":\"yahux\",\"tags\":{\"xj\":\"mqnjaqw\",\"atscmd\":\"prozvcputegjvwmf\"},\"id\":\"pjhulsuuvmkj\",\"name\":\"zkrwfn\",\"type\":\"iodjp\"}") - .toObject(DeviceInner.class); - Assertions.assertEquals("yahux", model.location()); - Assertions.assertEquals("mqnjaqw", model.tags().get("xj")); - } - - @Test - public void testSerialize() { - DeviceInner model = - new DeviceInner() - .withLocation("yahux") - .withTags(mapOf("xj", "mqnjaqw", "atscmd", "prozvcputegjvwmf")) - .withProperties(new DevicePropertiesFormat()); - model = BinaryData.fromObject(model).toObject(DeviceInner.class); - Assertions.assertEquals("yahux", model.location()); - Assertions.assertEquals("mqnjaqw", model.tags().get("xj")); - } - - @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceListResultTests.java deleted file mode 100644 index cf859c91db23..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DeviceListResultTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.DeviceInner; -import com.azure.resourcemanager.hybridnetwork.models.DeviceListResult; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeviceListResultTests { - @Test - public void testDeserialize() { - DeviceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Deleted\",\"provisioningState\":\"Unknown\",\"networkFunctions\":[]},\"location\":\"thqt\",\"tags\":{\"zfsinzgvf\":\"jbp\",\"j\":\"jrwzox\",\"fpjkjlxofp\":\"felluwfzitonpe\"},\"id\":\"vhpfxxypininmay\",\"name\":\"uybbkpodep\",\"type\":\"oginuvamiheognar\"},{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Registered\",\"provisioningState\":\"Deleting\",\"networkFunctions\":[]},\"location\":\"usivye\",\"tags\":{\"un\":\"iqihn\",\"fygxgispemvtzfk\":\"bwjzr\",\"fxqeof\":\"fublj\"},\"id\":\"aeqjhqjbasvms\",\"name\":\"jqul\",\"type\":\"gsntnbybkzgcwr\"},{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"networkFunctions\":[]},\"location\":\"jdous\",\"tags\":{\"xbnjbiksq\":\"vkocrcjdkwtn\",\"ainqpjwnzlljfm\":\"gls\"},\"id\":\"pee\",\"name\":\"vmgxsab\",\"type\":\"yqduujit\"}],\"nextLink\":\"czdzev\"}") - .toObject(DeviceListResult.class); - Assertions.assertEquals("thqt", model.value().get(0).location()); - Assertions.assertEquals("jbp", model.value().get(0).tags().get("zfsinzgvf")); - } - - @Test - public void testSerialize() { - DeviceListResult model = - new DeviceListResult() - .withValue( - Arrays - .asList( - new DeviceInner() - .withLocation("thqt") - .withTags(mapOf("zfsinzgvf", "jbp", "j", "jrwzox", "fpjkjlxofp", "felluwfzitonpe")) - .withProperties(new DevicePropertiesFormat()), - new DeviceInner() - .withLocation("usivye") - .withTags(mapOf("un", "iqihn", "fygxgispemvtzfk", "bwjzr", "fxqeof", "fublj")) - .withProperties(new DevicePropertiesFormat()), - new DeviceInner() - .withLocation("jdous") - .withTags(mapOf("xbnjbiksq", "vkocrcjdkwtn", "ainqpjwnzlljfm", "gls")) - .withProperties(new DevicePropertiesFormat()))); - model = BinaryData.fromObject(model).toObject(DeviceListResult.class); - Assertions.assertEquals("thqt", model.value().get(0).location()); - Assertions.assertEquals("jbp", model.value().get(0).tags().get("zfsinzgvf")); - } - - @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicePropertiesFormatTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicePropertiesFormatTests.java deleted file mode 100644 index 4e29e5fd7288..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicePropertiesFormatTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; -import org.junit.jupiter.api.Test; - -public final class DevicePropertiesFormatTests { - @Test - public void testDeserialize() { - DevicePropertiesFormat model = - BinaryData - .fromString( - "{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Unknown\",\"provisioningState\":\"Canceled\",\"networkFunctions\":[{\"id\":\"wryoqpsoacc\"},{\"id\":\"zakljlahbc\"},{\"id\":\"ffdfdosygexpa\"},{\"id\":\"akhmsbzjhcrz\"}]}") - .toObject(DevicePropertiesFormat.class); - } - - @Test - public void testSerialize() { - DevicePropertiesFormat model = new DevicePropertiesFormat(); - model = BinaryData.fromObject(model).toObject(DevicePropertiesFormat.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateMockTests.java deleted file mode 100644 index 12e7bfcfe1fb..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Device; -import com.azure.resourcemanager.hybridnetwork.models.DevicePropertiesFormat; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DevicesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Registered\",\"provisioningState\":\"Succeeded\",\"networkFunctions\":[]},\"location\":\"hashsfwxosow\",\"tags\":{\"ucww\":\"ugicjooxdjebw\",\"bvmeuecivy\":\"vo\",\"ueiotwmcdyt\":\"zceuojgjrw\"},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Device response = - manager - .devices() - .define("uhcdhm") - .withRegion("vfadmws") - .withExistingResourceGroup("ahvljuaha") - .withTags(mapOf("gomz", "gvxp")) - .withProperties(new DevicePropertiesFormat()) - .create(); - - Assertions.assertEquals("hashsfwxosow", response.location()); - Assertions.assertEquals("ugicjooxdjebw", response.tags().get("ucww")); - } - - @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteMockTests.java deleted file mode 100644 index 79fe3343b7c6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DevicesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.devices().delete("nv", "t", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupMockTests.java deleted file mode 100644 index 468cbcf2c936..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListByResourceGroupMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Device; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DevicesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Registered\",\"provisioningState\":\"Failed\",\"networkFunctions\":[]},\"location\":\"xsbkyvpyca\",\"tags\":{\"nwbmeh\":\"bpzkafkuwbc\"},\"id\":\"seyvj\",\"name\":\"srtslhspkdeem\",\"type\":\"ofmxagkvtmelmqkr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.devices().listByResourceGroup("qj", Context.NONE); - - Assertions.assertEquals("xsbkyvpyca", response.iterator().next().location()); - Assertions.assertEquals("bpzkafkuwbc", response.iterator().next().tags().get("nwbmeh")); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListMockTests.java deleted file mode 100644 index c4d5c9f14e52..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/DevicesListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Device; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DevicesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceType\":\"DevicePropertiesFormat\",\"status\":\"Deleted\",\"provisioningState\":\"Failed\",\"networkFunctions\":[]},\"location\":\"plpho\",\"tags\":{\"ye\":\"crpab\",\"azqugxywpmueefj\":\"sbj\",\"dsuyonobgla\":\"wfqkquj\",\"tcc\":\"cq\"},\"id\":\"g\",\"name\":\"udxytlmoyrx\",\"type\":\"wfudwpzntxhdzhl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.devices().list(Context.NONE); - - Assertions.assertEquals("plpho", response.iterator().next().location()); - Assertions.assertEquals("crpab", response.iterator().next().tags().get("ye")); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/ImageReferenceTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/ImageReferenceTests.java deleted file mode 100644 index f121f1114e9b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/ImageReferenceTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.ImageReference; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ImageReferenceTests { - @Test - public void testDeserialize() { - ImageReference model = - BinaryData - .fromString( - "{\"publisher\":\"umasxazjpq\",\"offer\":\"gual\",\"sku\":\"xxhejjzzvd\",\"version\":\"gwdslfhotwm\",\"exactVersion\":\"npwlbjnpg\"}") - .toObject(ImageReference.class); - Assertions.assertEquals("umasxazjpq", model.publisher()); - Assertions.assertEquals("gual", model.offer()); - Assertions.assertEquals("xxhejjzzvd", model.sku()); - Assertions.assertEquals("gwdslfhotwm", model.version()); - Assertions.assertEquals("npwlbjnpg", model.exactVersion()); - } - - @Test - public void testSerialize() { - ImageReference model = - new ImageReference() - .withPublisher("umasxazjpq") - .withOffer("gual") - .withSku("xxhejjzzvd") - .withVersion("gwdslfhotwm") - .withExactVersion("npwlbjnpg"); - model = BinaryData.fromObject(model).toObject(ImageReference.class); - Assertions.assertEquals("umasxazjpq", model.publisher()); - Assertions.assertEquals("gual", model.offer()); - Assertions.assertEquals("xxhejjzzvd", model.sku()); - Assertions.assertEquals("gwdslfhotwm", model.version()); - Assertions.assertEquals("npwlbjnpg", model.exactVersion()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleConfigurationTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleConfigurationTests.java deleted file mode 100644 index 2366fc10e8c6..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleConfigurationTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.CustomProfile; -import com.azure.resourcemanager.hybridnetwork.models.DataDisk; -import com.azure.resourcemanager.hybridnetwork.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.hybridnetwork.models.ImageReference; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfigurationType; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes; -import com.azure.resourcemanager.hybridnetwork.models.OsDisk; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.StorageProfile; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import com.azure.resourcemanager.hybridnetwork.models.VirtualMachineSizeTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionRoleConfigurationTests { - @Test - public void testDeserialize() { - NetworkFunctionRoleConfiguration model = - BinaryData - .fromString( - "{\"roleName\":\"zvddntwndeicbtwn\",\"roleType\":\"Unknown\",\"virtualMachineSize\":\"Standard_D5_v2\",\"osProfile\":{\"adminUsername\":\"hrhcffcyddglmjth\",\"linuxConfiguration\":{},\"customData\":\"pyeicxm\",\"customDataRequired\":false},\"networkInterfaces\":[{\"networkInterfaceName\":\"hix\",\"macAddress\":\"gdtopbobjogh\",\"ipConfigurations\":[],\"vmSwitchType\":\"Unknown\"}],\"storageProfile\":{\"imageReference\":{\"publisher\":\"hrzayvvtpgvdf\",\"offer\":\"otkftutqxlngx\",\"sku\":\"fgugnxkrxdqmid\",\"version\":\"hzrvqd\",\"exactVersion\":\"bhj\"},\"osDisk\":{\"osType\":\"Windows\",\"name\":\"h\",\"diskSizeGB\":1256732319},\"dataDisks\":[{\"createOption\":\"Empty\",\"name\":\"nyktzlcuiy\",\"diskSizeGB\":616844240}]},\"customProfile\":{\"metadataConfigurationPath\":\"gndrvynh\"}}") - .toObject(NetworkFunctionRoleConfiguration.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.roleName()); - Assertions.assertEquals(NetworkFunctionRoleConfigurationType.UNKNOWN, model.roleType()); - Assertions.assertEquals(VirtualMachineSizeTypes.STANDARD_D5_V2, model.virtualMachineSize()); - Assertions.assertEquals("hrhcffcyddglmjth", model.osProfile().adminUsername()); - Assertions.assertEquals("pyeicxm", model.osProfile().customData()); - Assertions.assertEquals(false, model.osProfile().customDataRequired()); - Assertions.assertEquals("hix", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("gdtopbobjogh", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.UNKNOWN, model.networkInterfaces().get(0).vmSwitchType()); - Assertions.assertEquals("hrzayvvtpgvdf", model.storageProfile().imageReference().publisher()); - Assertions.assertEquals("otkftutqxlngx", model.storageProfile().imageReference().offer()); - Assertions.assertEquals("fgugnxkrxdqmid", model.storageProfile().imageReference().sku()); - Assertions.assertEquals("hzrvqd", model.storageProfile().imageReference().version()); - Assertions.assertEquals("bhj", model.storageProfile().imageReference().exactVersion()); - Assertions.assertEquals(OperatingSystemTypes.WINDOWS, model.storageProfile().osDisk().osType()); - Assertions.assertEquals("h", model.storageProfile().osDisk().name()); - Assertions.assertEquals(1256732319, model.storageProfile().osDisk().diskSizeGB()); - Assertions.assertEquals(DiskCreateOptionTypes.EMPTY, model.storageProfile().dataDisks().get(0).createOption()); - Assertions.assertEquals("nyktzlcuiy", model.storageProfile().dataDisks().get(0).name()); - Assertions.assertEquals(616844240, model.storageProfile().dataDisks().get(0).diskSizeGB()); - Assertions.assertEquals("gndrvynh", model.customProfile().metadataConfigurationPath()); - } - - @Test - public void testSerialize() { - NetworkFunctionRoleConfiguration model = - new NetworkFunctionRoleConfiguration() - .withRoleName("zvddntwndeicbtwn") - .withRoleType(NetworkFunctionRoleConfigurationType.UNKNOWN) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D5_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("hrhcffcyddglmjth") - .withLinuxConfiguration(new LinuxConfiguration()) - .withCustomData("pyeicxm") - .withCustomDataRequired(false)) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("hix") - .withMacAddress("gdtopbobjogh") - .withIpConfigurations(Arrays.asList()) - .withVmSwitchType(VMSwitchType.UNKNOWN))) - .withStorageProfile( - new StorageProfile() - .withImageReference( - new ImageReference() - .withPublisher("hrzayvvtpgvdf") - .withOffer("otkftutqxlngx") - .withSku("fgugnxkrxdqmid") - .withVersion("hzrvqd") - .withExactVersion("bhj")) - .withOsDisk( - new OsDisk() - .withOsType(OperatingSystemTypes.WINDOWS) - .withName("h") - .withDiskSizeGB(1256732319)) - .withDataDisks( - Arrays - .asList( - new DataDisk() - .withCreateOption(DiskCreateOptionTypes.EMPTY) - .withName("nyktzlcuiy") - .withDiskSizeGB(616844240)))) - .withCustomProfile(new CustomProfile().withMetadataConfigurationPath("gndrvynh")); - model = BinaryData.fromObject(model).toObject(NetworkFunctionRoleConfiguration.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.roleName()); - Assertions.assertEquals(NetworkFunctionRoleConfigurationType.UNKNOWN, model.roleType()); - Assertions.assertEquals(VirtualMachineSizeTypes.STANDARD_D5_V2, model.virtualMachineSize()); - Assertions.assertEquals("hrhcffcyddglmjth", model.osProfile().adminUsername()); - Assertions.assertEquals("pyeicxm", model.osProfile().customData()); - Assertions.assertEquals(false, model.osProfile().customDataRequired()); - Assertions.assertEquals("hix", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("gdtopbobjogh", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.UNKNOWN, model.networkInterfaces().get(0).vmSwitchType()); - Assertions.assertEquals("hrzayvvtpgvdf", model.storageProfile().imageReference().publisher()); - Assertions.assertEquals("otkftutqxlngx", model.storageProfile().imageReference().offer()); - Assertions.assertEquals("fgugnxkrxdqmid", model.storageProfile().imageReference().sku()); - Assertions.assertEquals("hzrvqd", model.storageProfile().imageReference().version()); - Assertions.assertEquals("bhj", model.storageProfile().imageReference().exactVersion()); - Assertions.assertEquals(OperatingSystemTypes.WINDOWS, model.storageProfile().osDisk().osType()); - Assertions.assertEquals("h", model.storageProfile().osDisk().name()); - Assertions.assertEquals(1256732319, model.storageProfile().osDisk().diskSizeGB()); - Assertions.assertEquals(DiskCreateOptionTypes.EMPTY, model.storageProfile().dataDisks().get(0).createOption()); - Assertions.assertEquals("nyktzlcuiy", model.storageProfile().dataDisks().get(0).name()); - Assertions.assertEquals(616844240, model.storageProfile().dataDisks().get(0).diskSizeGB()); - Assertions.assertEquals("gndrvynh", model.customProfile().metadataConfigurationPath()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleInstanceListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleInstanceListResultTests.java deleted file mode 100644 index 1e7d3b515d60..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionRoleInstanceListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleInstanceListResult; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionRoleInstanceListResultTests { - @Test - public void testDeserialize() { - NetworkFunctionRoleInstanceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"zyoxaepdkzjan\",\"id\":\"xibxujwbhqwalm\",\"type\":\"ux\",\"properties\":{\"provisioningState\":\"Succeeded\",\"operationalState\":\"Unknown\"}}],\"nextLink\":\"d\"}") - .toObject(NetworkFunctionRoleInstanceListResult.class); - } - - @Test - public void testSerialize() { - NetworkFunctionRoleInstanceListResult model = new NetworkFunctionRoleInstanceListResult(); - model = BinaryData.fromObject(model).toObject(NetworkFunctionRoleInstanceListResult.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuDetailsTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuDetailsTests.java deleted file mode 100644 index 0893839a9a44..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuDetailsTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuDetails; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionSkuDetailsTests { - @Test - public void testDeserialize() { - NetworkFunctionSkuDetails model = - BinaryData - .fromString( - "{\"skuType\":\"Unknown\",\"value\":[{\"roleName\":\"svexcsonpclhoco\",\"networkInterfaces\":[]}],\"nextLink\":\"leggzfbu\"}") - .toObject(NetworkFunctionSkuDetails.class); - Assertions.assertEquals(SkuType.UNKNOWN, model.skuType()); - Assertions.assertEquals("svexcsonpclhoco", model.value().get(0).roleName()); - } - - @Test - public void testSerialize() { - NetworkFunctionSkuDetails model = - new NetworkFunctionSkuDetails() - .withSkuType(SkuType.UNKNOWN) - .withValue( - Arrays - .asList( - new NetworkFunctionSkuRoleDetailsInner() - .withRoleName("svexcsonpclhoco") - .withNetworkInterfaces(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionSkuDetails.class); - Assertions.assertEquals(SkuType.UNKNOWN, model.skuType()); - Assertions.assertEquals("svexcsonpclhoco", model.value().get(0).roleName()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuListResultTests.java deleted file mode 100644 index c7916f7f0819..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuListResultTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuListResult; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionSkuListResultTests { - @Test - public void testDeserialize() { - NetworkFunctionSkuListResult model = - BinaryData - .fromString( - "{\"value\":[{\"skuName\":\"ofoskghs\",\"skuType\":\"EvolvedPacketCore\"}],\"nextLink\":\"mjmvxieduugidyjr\"}") - .toObject(NetworkFunctionSkuListResult.class); - Assertions.assertEquals("ofoskghs", model.value().get(0).skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.value().get(0).skuType()); - } - - @Test - public void testSerialize() { - NetworkFunctionSkuListResult model = - new NetworkFunctionSkuListResult() - .withValue( - Arrays - .asList( - new SkuOverviewInner().withSkuName("ofoskghs").withSkuType(SkuType.EVOLVED_PACKET_CORE))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionSkuListResult.class); - Assertions.assertEquals("ofoskghs", model.value().get(0).skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.value().get(0).skuType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuRoleDetailsInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuRoleDetailsInnerTests.java deleted file mode 100644 index 65d6d7a47f46..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionSkuRoleDetailsInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionSkuRoleDetailsInnerTests { - @Test - public void testDeserialize() { - NetworkFunctionSkuRoleDetailsInner model = - BinaryData - .fromString( - "{\"roleName\":\"mvfaxkffeiith\",\"networkInterfaces\":[{\"networkInterfaceName\":\"v\",\"macAddress\":\"xmzsbbzogg\",\"ipConfigurations\":[],\"vmSwitchType\":\"Lan\"}]}") - .toObject(NetworkFunctionSkuRoleDetailsInner.class); - Assertions.assertEquals("mvfaxkffeiith", model.roleName()); - Assertions.assertEquals("v", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("xmzsbbzogg", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.LAN, model.networkInterfaces().get(0).vmSwitchType()); - } - - @Test - public void testSerialize() { - NetworkFunctionSkuRoleDetailsInner model = - new NetworkFunctionSkuRoleDetailsInner() - .withRoleName("mvfaxkffeiith") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("v") - .withMacAddress("xmzsbbzogg") - .withIpConfigurations(Arrays.asList()) - .withVmSwitchType(VMSwitchType.LAN))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionSkuRoleDetailsInner.class); - Assertions.assertEquals("mvfaxkffeiith", model.roleName()); - Assertions.assertEquals("v", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("xmzsbbzogg", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.LAN, model.networkInterfaces().get(0).vmSwitchType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionTemplateTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionTemplateTests.java deleted file mode 100644 index d71f4925b18b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionTemplateTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.CustomProfile; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfigurationType; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.StorageProfile; -import com.azure.resourcemanager.hybridnetwork.models.VirtualMachineSizeTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionTemplateTests { - @Test - public void testDeserialize() { - NetworkFunctionTemplate model = - BinaryData - .fromString( - "{\"networkFunctionRoleConfigurations\":[{\"roleName\":\"qabnmoc\",\"roleType\":\"Unknown\",\"virtualMachineSize\":\"Standard_D5_v2\",\"osProfile\":{\"adminUsername\":\"zafb\",\"customData\":\"gpbtoqcjmklj\",\"customDataRequired\":false},\"networkInterfaces\":[],\"storageProfile\":{\"dataDisks\":[]},\"customProfile\":{\"metadataConfigurationPath\":\"l\"}},{\"roleName\":\"u\",\"roleType\":\"VirtualMachine\",\"virtualMachineSize\":\"Standard_D3_v2\",\"osProfile\":{\"adminUsername\":\"bzhfepgzgqexz\",\"customData\":\"xscpaierhhbc\",\"customDataRequired\":false},\"networkInterfaces\":[],\"storageProfile\":{\"dataDisks\":[]},\"customProfile\":{\"metadataConfigurationPath\":\"xobnbdxkqpxok\"}},{\"roleName\":\"ionpimexg\",\"roleType\":\"Unknown\",\"virtualMachineSize\":\"Standard_D5_v2\",\"osProfile\":{\"adminUsername\":\"dg\",\"customData\":\"jrmvdjwzrlo\",\"customDataRequired\":true},\"networkInterfaces\":[],\"storageProfile\":{\"dataDisks\":[]},\"customProfile\":{\"metadataConfigurationPath\":\"tbzaqsqsycbkbfk\"}},{\"roleName\":\"kdkexxp\",\"roleType\":\"Unknown\",\"virtualMachineSize\":\"Unknown\",\"osProfile\":{\"adminUsername\":\"c\",\"customData\":\"gddtocj\",\"customDataRequired\":false},\"networkInterfaces\":[],\"storageProfile\":{\"dataDisks\":[]},\"customProfile\":{\"metadataConfigurationPath\":\"xibqeojnx\"}}]}") - .toObject(NetworkFunctionTemplate.class); - Assertions.assertEquals("qabnmoc", model.networkFunctionRoleConfigurations().get(0).roleName()); - Assertions - .assertEquals( - NetworkFunctionRoleConfigurationType.UNKNOWN, - model.networkFunctionRoleConfigurations().get(0).roleType()); - Assertions - .assertEquals( - VirtualMachineSizeTypes.STANDARD_D5_V2, - model.networkFunctionRoleConfigurations().get(0).virtualMachineSize()); - Assertions.assertEquals("zafb", model.networkFunctionRoleConfigurations().get(0).osProfile().adminUsername()); - Assertions - .assertEquals("gpbtoqcjmklj", model.networkFunctionRoleConfigurations().get(0).osProfile().customData()); - Assertions - .assertEquals(false, model.networkFunctionRoleConfigurations().get(0).osProfile().customDataRequired()); - Assertions - .assertEquals( - "l", model.networkFunctionRoleConfigurations().get(0).customProfile().metadataConfigurationPath()); - } - - @Test - public void testSerialize() { - NetworkFunctionTemplate model = - new NetworkFunctionTemplate() - .withNetworkFunctionRoleConfigurations( - Arrays - .asList( - new NetworkFunctionRoleConfiguration() - .withRoleName("qabnmoc") - .withRoleType(NetworkFunctionRoleConfigurationType.UNKNOWN) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D5_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("zafb") - .withCustomData("gpbtoqcjmklj") - .withCustomDataRequired(false)) - .withNetworkInterfaces(Arrays.asList()) - .withStorageProfile(new StorageProfile().withDataDisks(Arrays.asList())) - .withCustomProfile(new CustomProfile().withMetadataConfigurationPath("l")), - new NetworkFunctionRoleConfiguration() - .withRoleName("u") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D3_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("bzhfepgzgqexz") - .withCustomData("xscpaierhhbc") - .withCustomDataRequired(false)) - .withNetworkInterfaces(Arrays.asList()) - .withStorageProfile(new StorageProfile().withDataDisks(Arrays.asList())) - .withCustomProfile(new CustomProfile().withMetadataConfigurationPath("xobnbdxkqpxok")), - new NetworkFunctionRoleConfiguration() - .withRoleName("ionpimexg") - .withRoleType(NetworkFunctionRoleConfigurationType.UNKNOWN) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D5_V2) - .withOsProfile( - new OsProfile() - .withAdminUsername("dg") - .withCustomData("jrmvdjwzrlo") - .withCustomDataRequired(true)) - .withNetworkInterfaces(Arrays.asList()) - .withStorageProfile(new StorageProfile().withDataDisks(Arrays.asList())) - .withCustomProfile( - new CustomProfile().withMetadataConfigurationPath("tbzaqsqsycbkbfk")), - new NetworkFunctionRoleConfiguration() - .withRoleName("kdkexxp") - .withRoleType(NetworkFunctionRoleConfigurationType.UNKNOWN) - .withVirtualMachineSize(VirtualMachineSizeTypes.UNKNOWN) - .withOsProfile( - new OsProfile() - .withAdminUsername("c") - .withCustomData("gddtocj") - .withCustomDataRequired(false)) - .withNetworkInterfaces(Arrays.asList()) - .withStorageProfile(new StorageProfile().withDataDisks(Arrays.asList())) - .withCustomProfile(new CustomProfile().withMetadataConfigurationPath("xibqeojnx")))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionTemplate.class); - Assertions.assertEquals("qabnmoc", model.networkFunctionRoleConfigurations().get(0).roleName()); - Assertions - .assertEquals( - NetworkFunctionRoleConfigurationType.UNKNOWN, - model.networkFunctionRoleConfigurations().get(0).roleType()); - Assertions - .assertEquals( - VirtualMachineSizeTypes.STANDARD_D5_V2, - model.networkFunctionRoleConfigurations().get(0).virtualMachineSize()); - Assertions.assertEquals("zafb", model.networkFunctionRoleConfigurations().get(0).osProfile().adminUsername()); - Assertions - .assertEquals("gpbtoqcjmklj", model.networkFunctionRoleConfigurations().get(0).osProfile().customData()); - Assertions - .assertEquals(false, model.networkFunctionRoleConfigurations().get(0).osProfile().customDataRequired()); - Assertions - .assertEquals( - "l", model.networkFunctionRoleConfigurations().get(0).customProfile().metadataConfigurationPath()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationOsProfileTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationOsProfileTests.java deleted file mode 100644 index 549b20a41866..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationOsProfileTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfigurationOsProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionUserConfigurationOsProfileTests { - @Test - public void testDeserialize() { - NetworkFunctionUserConfigurationOsProfile model = - BinaryData - .fromString("{\"customData\":\"kknryrtihf\"}") - .toObject(NetworkFunctionUserConfigurationOsProfile.class); - Assertions.assertEquals("kknryrtihf", model.customData()); - } - - @Test - public void testSerialize() { - NetworkFunctionUserConfigurationOsProfile model = - new NetworkFunctionUserConfigurationOsProfile().withCustomData("kknryrtihf"); - model = BinaryData.fromObject(model).toObject(NetworkFunctionUserConfigurationOsProfile.class); - Assertions.assertEquals("kknryrtihf", model.customData()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationTests.java deleted file mode 100644 index 7c31d0c22115..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionUserConfigurationTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionUserConfigurationOsProfile; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionUserConfigurationTests { - @Test - public void testDeserialize() { - NetworkFunctionUserConfiguration model = - BinaryData - .fromString( - "{\"roleName\":\"oqijgkdmbpaz\",\"networkInterfaces\":[{\"networkInterfaceName\":\"fp\",\"macAddress\":\"nrbtcqqjnq\",\"ipConfigurations\":[],\"vmSwitchType\":\"Management\"}],\"osProfile\":{\"customData\":\"foooj\"}}") - .toObject(NetworkFunctionUserConfiguration.class); - Assertions.assertEquals("oqijgkdmbpaz", model.roleName()); - Assertions.assertEquals("fp", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("nrbtcqqjnq", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.MANAGEMENT, model.networkInterfaces().get(0).vmSwitchType()); - Assertions.assertEquals("foooj", model.osProfile().customData()); - } - - @Test - public void testSerialize() { - NetworkFunctionUserConfiguration model = - new NetworkFunctionUserConfiguration() - .withRoleName("oqijgkdmbpaz") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("fp") - .withMacAddress("nrbtcqqjnq") - .withIpConfigurations(Arrays.asList()) - .withVmSwitchType(VMSwitchType.MANAGEMENT))) - .withOsProfile(new NetworkFunctionUserConfigurationOsProfile().withCustomData("foooj")); - model = BinaryData.fromObject(model).toObject(NetworkFunctionUserConfiguration.class); - Assertions.assertEquals("oqijgkdmbpaz", model.roleName()); - Assertions.assertEquals("fp", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("nrbtcqqjnq", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.MANAGEMENT, model.networkInterfaces().get(0).vmSwitchType()); - Assertions.assertEquals("foooj", model.osProfile().customData()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorConfigurationTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorConfigurationTests.java deleted file mode 100644 index ca2481acc3b4..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorConfigurationTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.LinuxConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionVendorConfigurationTests { - @Test - public void testDeserialize() { - NetworkFunctionVendorConfiguration model = - BinaryData - .fromString( - "{\"roleName\":\"vyxlwhzlsicohoqq\",\"osProfile\":{\"adminUsername\":\"lryav\",\"linuxConfiguration\":{},\"customData\":\"unmmq\",\"customDataRequired\":false},\"networkInterfaces\":[{\"networkInterfaceName\":\"noc\",\"macAddress\":\"oklyaxuconuq\",\"ipConfigurations\":[],\"vmSwitchType\":\"Wan\"},{\"networkInterfaceName\":\"ypewrmjmwvvjekt\",\"macAddress\":\"senhwlrs\",\"ipConfigurations\":[],\"vmSwitchType\":\"Management\"}]}") - .toObject(NetworkFunctionVendorConfiguration.class); - Assertions.assertEquals("vyxlwhzlsicohoqq", model.roleName()); - Assertions.assertEquals("lryav", model.osProfile().adminUsername()); - Assertions.assertEquals("unmmq", model.osProfile().customData()); - Assertions.assertEquals(false, model.osProfile().customDataRequired()); - Assertions.assertEquals("noc", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("oklyaxuconuq", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.WAN, model.networkInterfaces().get(0).vmSwitchType()); - } - - @Test - public void testSerialize() { - NetworkFunctionVendorConfiguration model = - new NetworkFunctionVendorConfiguration() - .withRoleName("vyxlwhzlsicohoqq") - .withOsProfile( - new OsProfile() - .withAdminUsername("lryav") - .withLinuxConfiguration(new LinuxConfiguration()) - .withCustomData("unmmq") - .withCustomDataRequired(false)) - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterface() - .withNetworkInterfaceName("noc") - .withMacAddress("oklyaxuconuq") - .withIpConfigurations(Arrays.asList()) - .withVmSwitchType(VMSwitchType.WAN), - new NetworkInterface() - .withNetworkInterfaceName("ypewrmjmwvvjekt") - .withMacAddress("senhwlrs") - .withIpConfigurations(Arrays.asList()) - .withVmSwitchType(VMSwitchType.MANAGEMENT))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionVendorConfiguration.class); - Assertions.assertEquals("vyxlwhzlsicohoqq", model.roleName()); - Assertions.assertEquals("lryav", model.osProfile().adminUsername()); - Assertions.assertEquals("unmmq", model.osProfile().customData()); - Assertions.assertEquals(false, model.osProfile().customDataRequired()); - Assertions.assertEquals("noc", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("oklyaxuconuq", model.networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.WAN, model.networkInterfaces().get(0).vmSwitchType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorInnerTests.java deleted file mode 100644 index c15ddce776e4..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionVendorInnerTests { - @Test - public void testDeserialize() { - NetworkFunctionVendorInner model = - BinaryData - .fromString( - "{\"properties\":{\"vendorName\":\"i\",\"skuList\":[{\"skuName\":\"kdvjsll\",\"skuType\":\"Firewall\"},{\"skuName\":\"d\",\"skuType\":\"EvolvedPacketCore\"},{\"skuName\":\"kpnpulexxbczwtr\",\"skuType\":\"EvolvedPacketCore\"}]}}") - .toObject(NetworkFunctionVendorInner.class); - Assertions.assertEquals("i", model.vendorName()); - Assertions.assertEquals("kdvjsll", model.skuList().get(0).skuName()); - Assertions.assertEquals(SkuType.FIREWALL, model.skuList().get(0).skuType()); - } - - @Test - public void testSerialize() { - NetworkFunctionVendorInner model = - new NetworkFunctionVendorInner() - .withVendorName("i") - .withSkuList( - Arrays - .asList( - new SkuOverviewInner().withSkuName("kdvjsll").withSkuType(SkuType.FIREWALL), - new SkuOverviewInner().withSkuName("d").withSkuType(SkuType.EVOLVED_PACKET_CORE), - new SkuOverviewInner() - .withSkuName("kpnpulexxbczwtr") - .withSkuType(SkuType.EVOLVED_PACKET_CORE))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionVendorInner.class); - Assertions.assertEquals("i", model.vendorName()); - Assertions.assertEquals("kdvjsll", model.skuList().get(0).skuName()); - Assertions.assertEquals(SkuType.FIREWALL, model.skuList().get(0).skuType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorListResultTests.java deleted file mode 100644 index 6b6bef17aeee..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorListResultTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionVendorInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkFunctionVendorListResultTests { - @Test - public void testDeserialize() { - NetworkFunctionVendorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"vendorName\":\"fksymddystki\",\"skuList\":[]}}],\"nextLink\":\"hqyudxorrqnbpoc\"}") - .toObject(NetworkFunctionVendorListResult.class); - Assertions.assertEquals("fksymddystki", model.value().get(0).vendorName()); - } - - @Test - public void testSerialize() { - NetworkFunctionVendorListResult model = - new NetworkFunctionVendorListResult() - .withValue( - Arrays - .asList( - new NetworkFunctionVendorInner() - .withVendorName("fksymddystki") - .withSkuList(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(NetworkFunctionVendorListResult.class); - Assertions.assertEquals("fksymddystki", model.value().get(0).vendorName()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuMockTests.java deleted file mode 100644 index ddd512855216..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListBySkuMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFunctionVendorSkusListBySkuMockTests { - @Test - public void testListBySku() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"roleName\":\"qzvszjf\",\"networkInterfaces\":[{\"networkInterfaceName\":\"xxivetv\",\"macAddress\":\"qaqtdoqmcbxvwvxy\",\"ipConfigurations\":[],\"vmSwitchType\":\"Wan\"},{\"networkInterfaceName\":\"fxoblytkb\",\"macAddress\":\"pe\",\"ipConfigurations\":[],\"vmSwitchType\":\"Wan\"},{\"networkInterfaceName\":\"rvrnsvshqjohxc\",\"macAddress\":\"bfovasrruvwbhsq\",\"ipConfigurations\":[],\"vmSwitchType\":\"Wan\"},{\"networkInterfaceName\":\"jbi\",\"macAddress\":\"bpybsrfbjf\",\"ipConfigurations\":[],\"vmSwitchType\":\"Management\"}]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkFunctionVendorSkus().listBySku("u", "ivkrtsw", Context.NONE); - - Assertions.assertEquals("qzvszjf", response.iterator().next().roleName()); - Assertions - .assertEquals("xxivetv", response.iterator().next().networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("qaqtdoqmcbxvwvxy", response.iterator().next().networkInterfaces().get(0).macAddress()); - Assertions.assertEquals(VMSwitchType.WAN, response.iterator().next().networkInterfaces().get(0).vmSwitchType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorMockTests.java deleted file mode 100644 index bdb4162503dc..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorSkusListByVendorMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.SkuOverview; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFunctionVendorSkusListByVendorMockTests { - @Test - public void testListByVendor() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"skuName\":\"j\",\"skuType\":\"Firewall\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkFunctionVendorSkus().listByVendor("mjh", Context.NONE); - - Assertions.assertEquals("j", response.iterator().next().skuName()); - Assertions.assertEquals(SkuType.FIREWALL, response.iterator().next().skuType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListMockTests.java deleted file mode 100644 index 7edfaad10197..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionVendorsListMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendor; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFunctionVendorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"properties\":{\"vendorName\":\"mfqjhhkxbp\",\"skuList\":[]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkFunctionVendors().list(Context.NONE); - - Assertions.assertEquals("mfqjhhkxbp", response.iterator().next().vendorName()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteMockTests.java deleted file mode 100644 index ab1657ccdfde..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkFunctionsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFunctionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.networkFunctions().delete("fzab", "lcuhxwtctyqiklb", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceIpConfigurationTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceIpConfigurationTests.java deleted file mode 100644 index 408885af4dcd..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceIpConfigurationTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkInterfaceIpConfigurationTests { - @Test - public void testDeserialize() { - NetworkInterfaceIpConfiguration model = - BinaryData - .fromString( - "{\"ipAllocationMethod\":\"Dynamic\",\"ipAddress\":\"usarhmofc\",\"subnet\":\"smy\",\"gateway\":\"kdtmlxhekuk\",\"ipVersion\":\"Unknown\",\"dnsServers\":[\"kc\",\"mparcryuanzw\",\"xzdxtayrlhmwh\",\"pmrqobm\"]}") - .toObject(NetworkInterfaceIpConfiguration.class); - Assertions.assertEquals(IpAllocationMethod.DYNAMIC, model.ipAllocationMethod()); - Assertions.assertEquals("usarhmofc", model.ipAddress()); - Assertions.assertEquals("smy", model.subnet()); - Assertions.assertEquals("kdtmlxhekuk", model.gateway()); - Assertions.assertEquals(IpVersion.UNKNOWN, model.ipVersion()); - Assertions.assertEquals("kc", model.dnsServers().get(0)); - } - - @Test - public void testSerialize() { - NetworkInterfaceIpConfiguration model = - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.DYNAMIC) - .withIpAddress("usarhmofc") - .withSubnet("smy") - .withGateway("kdtmlxhekuk") - .withIpVersion(IpVersion.UNKNOWN) - .withDnsServers(Arrays.asList("kc", "mparcryuanzw", "xzdxtayrlhmwh", "pmrqobm")); - model = BinaryData.fromObject(model).toObject(NetworkInterfaceIpConfiguration.class); - Assertions.assertEquals(IpAllocationMethod.DYNAMIC, model.ipAllocationMethod()); - Assertions.assertEquals("usarhmofc", model.ipAddress()); - Assertions.assertEquals("smy", model.subnet()); - Assertions.assertEquals("kdtmlxhekuk", model.gateway()); - Assertions.assertEquals(IpVersion.UNKNOWN, model.ipVersion()); - Assertions.assertEquals("kc", model.dnsServers().get(0)); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceTests.java deleted file mode 100644 index 254c083bf8e1..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/NetworkInterfaceTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.IpAllocationMethod; -import com.azure.resourcemanager.hybridnetwork.models.IpVersion; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface; -import com.azure.resourcemanager.hybridnetwork.models.NetworkInterfaceIpConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NetworkInterfaceTests { - @Test - public void testDeserialize() { - NetworkInterface model = - BinaryData - .fromString( - "{\"networkInterfaceName\":\"ifsqesaagdfmg\",\"macAddress\":\"lhjxr\",\"ipConfigurations\":[{\"ipAllocationMethod\":\"Unknown\",\"ipAddress\":\"vktsizntocipao\",\"subnet\":\"jpsq\",\"gateway\":\"mpoyfd\",\"ipVersion\":\"IPv4\",\"dnsServers\":[\"nygj\",\"fjddeqs\",\"deupewnwrei\"]}],\"vmSwitchType\":\"Unknown\"}") - .toObject(NetworkInterface.class); - Assertions.assertEquals("ifsqesaagdfmg", model.networkInterfaceName()); - Assertions.assertEquals("lhjxr", model.macAddress()); - Assertions.assertEquals(IpAllocationMethod.UNKNOWN, model.ipConfigurations().get(0).ipAllocationMethod()); - Assertions.assertEquals("vktsizntocipao", model.ipConfigurations().get(0).ipAddress()); - Assertions.assertEquals("jpsq", model.ipConfigurations().get(0).subnet()); - Assertions.assertEquals("mpoyfd", model.ipConfigurations().get(0).gateway()); - Assertions.assertEquals(IpVersion.IPV4, model.ipConfigurations().get(0).ipVersion()); - Assertions.assertEquals("nygj", model.ipConfigurations().get(0).dnsServers().get(0)); - Assertions.assertEquals(VMSwitchType.UNKNOWN, model.vmSwitchType()); - } - - @Test - public void testSerialize() { - NetworkInterface model = - new NetworkInterface() - .withNetworkInterfaceName("ifsqesaagdfmg") - .withMacAddress("lhjxr") - .withIpConfigurations( - Arrays - .asList( - new NetworkInterfaceIpConfiguration() - .withIpAllocationMethod(IpAllocationMethod.UNKNOWN) - .withIpAddress("vktsizntocipao") - .withSubnet("jpsq") - .withGateway("mpoyfd") - .withIpVersion(IpVersion.IPV4) - .withDnsServers(Arrays.asList("nygj", "fjddeqs", "deupewnwrei")))) - .withVmSwitchType(VMSwitchType.UNKNOWN); - model = BinaryData.fromObject(model).toObject(NetworkInterface.class); - Assertions.assertEquals("ifsqesaagdfmg", model.networkInterfaceName()); - Assertions.assertEquals("lhjxr", model.macAddress()); - Assertions.assertEquals(IpAllocationMethod.UNKNOWN, model.ipConfigurations().get(0).ipAllocationMethod()); - Assertions.assertEquals("vktsizntocipao", model.ipConfigurations().get(0).ipAddress()); - Assertions.assertEquals("jpsq", model.ipConfigurations().get(0).subnet()); - Assertions.assertEquals("mpoyfd", model.ipConfigurations().get(0).gateway()); - Assertions.assertEquals(IpVersion.IPV4, model.ipConfigurations().get(0).ipVersion()); - Assertions.assertEquals("nygj", model.ipConfigurations().get(0).dnsServers().get(0)); - Assertions.assertEquals(VMSwitchType.UNKNOWN, model.vmSwitchType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationDisplayTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationDisplayTests.java deleted file mode 100644 index 691ed76154f7..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationDisplayTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"nqgoulzndli\",\"resource\":\"yqkgfg\",\"operation\":\"madgakeqsrxyb\",\"description\":\"qedqytbciqfoufl\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("nqgoulzndli", model.provider()); - Assertions.assertEquals("yqkgfg", model.resource()); - Assertions.assertEquals("madgakeqsrxyb", model.operation()); - Assertions.assertEquals("qedqytbciqfoufl", model.description()); - } - - @Test - public void testSerialize() { - OperationDisplay model = - new OperationDisplay() - .withProvider("nqgoulzndli") - .withResource("yqkgfg") - .withOperation("madgakeqsrxyb") - .withDescription("qedqytbciqfoufl"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("nqgoulzndli", model.provider()); - Assertions.assertEquals("yqkgfg", model.resource()); - Assertions.assertEquals("madgakeqsrxyb", model.operation()); - Assertions.assertEquals("qedqytbciqfoufl", model.description()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationInnerTests.java deleted file mode 100644 index c8619896d58e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.OperationInner; -import org.junit.jupiter.api.Test; - -public final class OperationInnerTests { - @Test - public void testDeserialize() { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"ozwyiftyhxhuro\",\"display\":{\"provider\":\"yxolniwp\",\"resource\":\"ukjfkgiawxklr\",\"operation\":\"lwckbasyypnddhs\",\"description\":\"bacphejko\"}}") - .toObject(OperationInner.class); - } - - @Test - public void testSerialize() { - OperationInner model = new OperationInner(); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationListTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationListTests.java deleted file mode 100644 index a5b5679c179e..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationListTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.OperationList; -import org.junit.jupiter.api.Test; - -public final class OperationListTests { - @Test - public void testDeserialize() { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"ppdsbdkvwrwj\",\"display\":{\"provider\":\"snhu\",\"resource\":\"eltmrldhugjzzdat\",\"operation\":\"hocdgeab\",\"description\":\"phut\"}}],\"nextLink\":\"ndv\"}") - .toObject(OperationList.class); - } - - @Test - public void testSerialize() { - OperationList model = new OperationList(); - model = BinaryData.fromObject(model).toObject(OperationList.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListMockTests.java deleted file mode 100644 index feb61e8a9245..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OperationsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"ni\",\"display\":{\"provider\":\"fbkp\",\"resource\":\"gklwn\",\"operation\":\"hjdauwhvylwz\",\"description\":\"dhxujznbmpo\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OsDiskTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OsDiskTests.java deleted file mode 100644 index f3e7bd811ef0..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/OsDiskTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes; -import com.azure.resourcemanager.hybridnetwork.models.OsDisk; -import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OsDiskTests { - @Test - public void testDeserialize() { - OsDisk model = - BinaryData - .fromString( - "{\"osType\":\"Linux\",\"name\":\"adehxnltyfsopp\",\"vhd\":{\"uri\":\"esnzwde\"},\"diskSizeGB\":600821678}") - .toObject(OsDisk.class); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osType()); - Assertions.assertEquals("adehxnltyfsopp", model.name()); - Assertions.assertEquals("esnzwde", model.vhd().uri()); - Assertions.assertEquals(600821678, model.diskSizeGB()); - } - - @Test - public void testSerialize() { - OsDisk model = - new OsDisk() - .withOsType(OperatingSystemTypes.LINUX) - .withName("adehxnltyfsopp") - .withVhd(new VirtualHardDisk().withUri("esnzwde")) - .withDiskSizeGB(600821678); - model = BinaryData.fromObject(model).toObject(OsDisk.class); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osType()); - Assertions.assertEquals("adehxnltyfsopp", model.name()); - Assertions.assertEquals("esnzwde", model.vhd().uri()); - Assertions.assertEquals(600821678, model.diskSizeGB()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionInnerTests.java deleted file mode 100644 index 13355e054bd5..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; -import org.junit.jupiter.api.Test; - -public final class PreviewSubscriptionInnerTests { - @Test - public void testDeserialize() { - PreviewSubscriptionInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"agfuaxbezyiu\",\"name\":\"kktwhrdxw\",\"type\":\"ywqsmbsurexim\"}") - .toObject(PreviewSubscriptionInner.class); - } - - @Test - public void testSerialize() { - PreviewSubscriptionInner model = new PreviewSubscriptionInner(); - model = BinaryData.fromObject(model).toObject(PreviewSubscriptionInner.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionPropertiesTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionPropertiesTests.java deleted file mode 100644 index 42fbc8c8e79d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionProperties; -import org.junit.jupiter.api.Test; - -public final class PreviewSubscriptionPropertiesTests { - @Test - public void testDeserialize() { - PreviewSubscriptionProperties model = - BinaryData.fromString("{\"provisioningState\":\"Canceled\"}").toObject(PreviewSubscriptionProperties.class); - } - - @Test - public void testSerialize() { - PreviewSubscriptionProperties model = new PreviewSubscriptionProperties(); - model = BinaryData.fromObject(model).toObject(PreviewSubscriptionProperties.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionsListTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionsListTests.java deleted file mode 100644 index 3d3be5fd5063..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/PreviewSubscriptionsListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscriptionsList; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class PreviewSubscriptionsListTests { - @Test - public void testDeserialize() { - PreviewSubscriptionsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"pfhyhl\",\"name\":\"rpmopjmc\",\"type\":\"atuokthfuiu\"}],\"nextLink\":\"dsfcpkvxodpuoz\"}") - .toObject(PreviewSubscriptionsList.class); - } - - @Test - public void testSerialize() { - PreviewSubscriptionsList model = - new PreviewSubscriptionsList().withValue(Arrays.asList(new PreviewSubscriptionInner())); - model = BinaryData.fromObject(model).toObject(PreviewSubscriptionsList.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstanceInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstanceInnerTests.java deleted file mode 100644 index a2ea12584a72..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstanceInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceInner; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RoleInstanceInnerTests { - @Test - public void testDeserialize() { - RoleInstanceInner model = - BinaryData - .fromString( - "{\"name\":\"fuwutttxf\",\"id\":\"brjcxe\",\"type\":\"jrbirphxepcyv\",\"properties\":{\"provisioningState\":\"Unknown\",\"operationalState\":\"Stopping\"}}") - .toObject(RoleInstanceInner.class); - Assertions.assertEquals("fuwutttxf", model.name()); - Assertions.assertEquals("brjcxe", model.id()); - Assertions.assertEquals("jrbirphxepcyv", model.type()); - Assertions.assertEquals(OperationalState.STOPPING, model.operationalState()); - } - - @Test - public void testSerialize() { - RoleInstanceInner model = - new RoleInstanceInner() - .withName("fuwutttxf") - .withId("brjcxe") - .withType("jrbirphxepcyv") - .withOperationalState(OperationalState.STOPPING); - model = BinaryData.fromObject(model).toObject(RoleInstanceInner.class); - Assertions.assertEquals("fuwutttxf", model.name()); - Assertions.assertEquals("brjcxe", model.id()); - Assertions.assertEquals("jrbirphxepcyv", model.type()); - Assertions.assertEquals(OperationalState.STOPPING, model.operationalState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancePropertiesTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancePropertiesTests.java deleted file mode 100644 index 7de117c963b1..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.RoleInstanceProperties; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RoleInstancePropertiesTests { - @Test - public void testDeserialize() { - RoleInstanceProperties model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\",\"operationalState\":\"Running\"}") - .toObject(RoleInstanceProperties.class); - Assertions.assertEquals(OperationalState.RUNNING, model.operationalState()); - } - - @Test - public void testSerialize() { - RoleInstanceProperties model = new RoleInstanceProperties().withOperationalState(OperationalState.RUNNING); - model = BinaryData.fromObject(model).toObject(RoleInstanceProperties.class); - Assertions.assertEquals(OperationalState.RUNNING, model.operationalState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListMockTests.java deleted file mode 100644 index d2c06b2856e8..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.OperationalState; -import com.azure.resourcemanager.hybridnetwork.models.RoleInstance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RoleInstancesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"iplbpodxunkbebxm\",\"id\":\"xndlkzgxhu\",\"type\":\"byyntwlrbqt\",\"properties\":{\"provisioningState\":\"Succeeded\",\"operationalState\":\"Stopped\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.roleInstances().list("konzmnsik", "mkqzeqqkdltfzxmh", "v", Context.NONE); - - Assertions.assertEquals("iplbpodxunkbebxm", response.iterator().next().name()); - Assertions.assertEquals("xndlkzgxhu", response.iterator().next().id()); - Assertions.assertEquals("byyntwlrbqt", response.iterator().next().type()); - Assertions.assertEquals(OperationalState.STOPPED, response.iterator().next().operationalState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartMockTests.java deleted file mode 100644 index fbea6b45d1db..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesRestartMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RoleInstancesRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.roleInstances().restart("lvwiwubmwmbesl", "nkww", "pp", "flcxoga", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartMockTests.java deleted file mode 100644 index b1515a254427..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStartMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RoleInstancesStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.roleInstances().start("cblylpstdbhhxsr", "dzu", "erscdntne", "fiwjmygtdssls", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopMockTests.java deleted file mode 100644 index 3c70d88f4106..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/RoleInstancesStopMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RoleInstancesStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.roleInstances().stop("tmweriofzpyq", "emwabnet", "hhszh", "d", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/SkuOverviewInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/SkuOverviewInnerTests.java deleted file mode 100644 index cdaacd3c8727..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/SkuOverviewInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuOverviewInnerTests { - @Test - public void testDeserialize() { - SkuOverviewInner model = - BinaryData - .fromString("{\"skuName\":\"khrs\",\"skuType\":\"EvolvedPacketCore\"}") - .toObject(SkuOverviewInner.class); - Assertions.assertEquals("khrs", model.skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuType()); - } - - @Test - public void testSerialize() { - SkuOverviewInner model = new SkuOverviewInner().withSkuName("khrs").withSkuType(SkuType.EVOLVED_PACKET_CORE); - model = BinaryData.fromObject(model).toObject(SkuOverviewInner.class); - Assertions.assertEquals("khrs", model.skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/StorageProfileTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/StorageProfileTests.java deleted file mode 100644 index 0de2568d369b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/StorageProfileTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.DataDisk; -import com.azure.resourcemanager.hybridnetwork.models.DiskCreateOptionTypes; -import com.azure.resourcemanager.hybridnetwork.models.ImageReference; -import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes; -import com.azure.resourcemanager.hybridnetwork.models.OsDisk; -import com.azure.resourcemanager.hybridnetwork.models.StorageProfile; -import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class StorageProfileTests { - @Test - public void testDeserialize() { - StorageProfile model = - BinaryData - .fromString( - "{\"imageReference\":{\"publisher\":\"nqbqqwxr\",\"offer\":\"eallnwsubisnj\",\"sku\":\"pmng\",\"version\":\"scxaq\",\"exactVersion\":\"ochcbonqvpkvl\"},\"osDisk\":{\"osType\":\"Linux\",\"name\":\"ase\",\"vhd\":{\"uri\":\"eo\"},\"diskSizeGB\":248230839},\"dataDisks\":[{\"createOption\":\"Unknown\",\"name\":\"enjbdlwtgrhp\",\"diskSizeGB\":469621378}]}") - .toObject(StorageProfile.class); - Assertions.assertEquals("nqbqqwxr", model.imageReference().publisher()); - Assertions.assertEquals("eallnwsubisnj", model.imageReference().offer()); - Assertions.assertEquals("pmng", model.imageReference().sku()); - Assertions.assertEquals("scxaq", model.imageReference().version()); - Assertions.assertEquals("ochcbonqvpkvl", model.imageReference().exactVersion()); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osDisk().osType()); - Assertions.assertEquals("ase", model.osDisk().name()); - Assertions.assertEquals("eo", model.osDisk().vhd().uri()); - Assertions.assertEquals(248230839, model.osDisk().diskSizeGB()); - Assertions.assertEquals(DiskCreateOptionTypes.UNKNOWN, model.dataDisks().get(0).createOption()); - Assertions.assertEquals("enjbdlwtgrhp", model.dataDisks().get(0).name()); - Assertions.assertEquals(469621378, model.dataDisks().get(0).diskSizeGB()); - } - - @Test - public void testSerialize() { - StorageProfile model = - new StorageProfile() - .withImageReference( - new ImageReference() - .withPublisher("nqbqqwxr") - .withOffer("eallnwsubisnj") - .withSku("pmng") - .withVersion("scxaq") - .withExactVersion("ochcbonqvpkvl")) - .withOsDisk( - new OsDisk() - .withOsType(OperatingSystemTypes.LINUX) - .withName("ase") - .withVhd(new VirtualHardDisk().withUri("eo")) - .withDiskSizeGB(248230839)) - .withDataDisks( - Arrays - .asList( - new DataDisk() - .withCreateOption(DiskCreateOptionTypes.UNKNOWN) - .withName("enjbdlwtgrhp") - .withDiskSizeGB(469621378))); - model = BinaryData.fromObject(model).toObject(StorageProfile.class); - Assertions.assertEquals("nqbqqwxr", model.imageReference().publisher()); - Assertions.assertEquals("eallnwsubisnj", model.imageReference().offer()); - Assertions.assertEquals("pmng", model.imageReference().sku()); - Assertions.assertEquals("scxaq", model.imageReference().version()); - Assertions.assertEquals("ochcbonqvpkvl", model.imageReference().exactVersion()); - Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osDisk().osType()); - Assertions.assertEquals("ase", model.osDisk().name()); - Assertions.assertEquals("eo", model.osDisk().vhd().uri()); - Assertions.assertEquals(248230839, model.osDisk().diskSizeGB()); - Assertions.assertEquals(DiskCreateOptionTypes.UNKNOWN, model.dataDisks().get(0).createOption()); - Assertions.assertEquals("enjbdlwtgrhp", model.dataDisks().get(0).name()); - Assertions.assertEquals(469621378, model.dataDisks().get(0).diskSizeGB()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/TagsObjectTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/TagsObjectTests.java deleted file mode 100644 index 3677d44cff8d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/TagsObjectTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.TagsObject; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TagsObjectTests { - @Test - public void testDeserialize() { - TagsObject model = - BinaryData - .fromString( - "{\"tags\":{\"zufcyzkohdbi\":\"jbpzvgnwzsymg\",\"th\":\"anufhfcbjysag\",\"yscnpqxu\":\"qhabifpikxwcz\",\"mjgr\":\"ivyqniwbybrkxvd\"}}") - .toObject(TagsObject.class); - Assertions.assertEquals("jbpzvgnwzsymg", model.tags().get("zufcyzkohdbi")); - } - - @Test - public void testSerialize() { - TagsObject model = - new TagsObject() - .withTags( - mapOf( - "zufcyzkohdbi", - "jbpzvgnwzsymg", - "th", - "anufhfcbjysag", - "yscnpqxu", - "qhabifpikxwcz", - "mjgr", - "ivyqniwbybrkxvd")); - model = BinaryData.fromObject(model).toObject(TagsObject.class); - Assertions.assertEquals("jbpzvgnwzsymg", model.tags().get("zufcyzkohdbi")); - } - - @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/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorDetailsTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorDetailsTests.java deleted file mode 100644 index 72457e097d1b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorDetailsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorDetails; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorDetailsTests { - @Test - public void testDeserialize() { - VendorDetails model = - BinaryData - .fromString( - "{\"vendorName\":\"zb\",\"skuList\":[{\"skuName\":\"ovm\",\"skuType\":\"EvolvedPacketCore\"},{\"skuName\":\"cspkwlhzdobpxjmf\",\"skuType\":\"SDWAN\"},{\"skuName\":\"nchrkcciww\",\"skuType\":\"SDWAN\"}]}") - .toObject(VendorDetails.class); - Assertions.assertEquals("zb", model.vendorName()); - Assertions.assertEquals("ovm", model.skuList().get(0).skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuList().get(0).skuType()); - } - - @Test - public void testSerialize() { - VendorDetails model = - new VendorDetails() - .withVendorName("zb") - .withSkuList( - Arrays - .asList( - new SkuOverviewInner().withSkuName("ovm").withSkuType(SkuType.EVOLVED_PACKET_CORE), - new SkuOverviewInner().withSkuName("cspkwlhzdobpxjmf").withSkuType(SkuType.SDWAN), - new SkuOverviewInner().withSkuName("nchrkcciww").withSkuType(SkuType.SDWAN))); - model = BinaryData.fromObject(model).toObject(VendorDetails.class); - Assertions.assertEquals("zb", model.vendorName()); - Assertions.assertEquals("ovm", model.skuList().get(0).skuName()); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuList().get(0).skuType()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorInnerTests.java deleted file mode 100644 index b08d3db35e08..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import org.junit.jupiter.api.Test; - -public final class VendorInnerTests { - @Test - public void testDeserialize() { - VendorInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"skus\":[{\"id\":\"odmgl\"},{\"id\":\"gpbkwtmut\"},{\"id\":\"qktapspwgcuert\"}]},\"id\":\"kdosvqw\",\"name\":\"bmdg\",\"type\":\"bjf\"}") - .toObject(VendorInner.class); - } - - @Test - public void testSerialize() { - VendorInner model = new VendorInner(); - model = BinaryData.fromObject(model).toObject(VendorInner.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorListResultTests.java deleted file mode 100644 index 9c94377c48ac..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorListResultTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class VendorListResultTests { - @Test - public void testDeserialize() { - VendorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"skus\":[]},\"id\":\"jaoyfhrtx\",\"name\":\"lnerkujysvleju\",\"type\":\"fqawrlyxw\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"skus\":[]},\"id\":\"nwbxgjvtbvpyssz\",\"name\":\"nruj\",\"type\":\"guhmuouqfpr\"},{\"properties\":{\"provisioningState\":\"Failed\",\"skus\":[]},\"id\":\"uitnwuiz\",\"name\":\"a\",\"type\":\"x\"},{\"properties\":{\"provisioningState\":\"Failed\",\"skus\":[]},\"id\":\"kyfi\",\"name\":\"rfidfvzwdz\",\"type\":\"htymw\"}],\"nextLink\":\"dkfthwxmnt\"}") - .toObject(VendorListResult.class); - } - - @Test - public void testSerialize() { - VendorListResult model = - new VendorListResult() - .withValue(Arrays.asList(new VendorInner(), new VendorInner(), new VendorInner(), new VendorInner())); - model = BinaryData.fromObject(model).toObject(VendorListResult.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionInnerTests.java deleted file mode 100644 index e1b53dfc5d47..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorNetworkFunctionInnerTests { - @Test - public void testDeserialize() { - VendorNetworkFunctionInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Deleted\",\"vendorProvisioningState\":\"Provisioned\",\"skuName\":\"xjnspy\",\"skuType\":\"Unknown\",\"networkFunctionVendorConfigurations\":[{\"roleName\":\"nkoukn\",\"networkInterfaces\":[]},{\"roleName\":\"iukbldngkpoci\",\"networkInterfaces\":[]},{\"roleName\":\"o\",\"networkInterfaces\":[]},{\"roleName\":\"jnpiucgyg\",\"networkInterfaces\":[]}]},\"id\":\"typmrbpizcdrqjsd\",\"name\":\"ydnfyhxdeoejz\",\"type\":\"cwif\"}") - .toObject(VendorNetworkFunctionInner.class); - Assertions.assertEquals(VendorProvisioningState.PROVISIONED, model.vendorProvisioningState()); - Assertions.assertEquals("nkoukn", model.networkFunctionVendorConfigurations().get(0).roleName()); - } - - @Test - public void testSerialize() { - VendorNetworkFunctionInner model = - new VendorNetworkFunctionInner() - .withVendorProvisioningState(VendorProvisioningState.PROVISIONED) - .withNetworkFunctionVendorConfigurations( - Arrays - .asList( - new NetworkFunctionVendorConfiguration() - .withRoleName("nkoukn") - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionVendorConfiguration() - .withRoleName("iukbldngkpoci") - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionVendorConfiguration() - .withRoleName("o") - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionVendorConfiguration() - .withRoleName("jnpiucgyg") - .withNetworkInterfaces(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(VendorNetworkFunctionInner.class); - Assertions.assertEquals(VendorProvisioningState.PROVISIONED, model.vendorProvisioningState()); - Assertions.assertEquals("nkoukn", model.networkFunctionVendorConfigurations().get(0).roleName()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionListResultTests.java deleted file mode 100644 index 761b874708e2..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionListResultTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionInner; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunctionListResult; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorNetworkFunctionListResultTests { - @Test - public void testDeserialize() { - VendorNetworkFunctionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"vendorProvisioningState\":\"UserDataValidationFailed\",\"skuName\":\"ujqgidok\",\"skuType\":\"SDWAN\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"oxgvclt\",\"name\":\"gsncghkjeszz\",\"type\":\"bijhtxfvgxbf\"},{\"properties\":{\"provisioningState\":\"Failed\",\"vendorProvisioningState\":\"Deprovisioned\",\"skuName\":\"pvecxgodeb\",\"skuType\":\"Unknown\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"bmpukgriwflz\",\"name\":\"fbxzpuzycisp\",\"type\":\"qzahmgkbrp\"},{\"properties\":{\"provisioningState\":\"Deleted\",\"vendorProvisioningState\":\"Provisioning\",\"skuName\":\"uqqkpik\",\"skuType\":\"EvolvedPacketCore\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"tqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"vendorProvisioningState\":\"NotProvisioned\",\"skuName\":\"bnlankxmyskpb\",\"skuType\":\"Firewall\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"kcxywnyt\",\"name\":\"rsyn\",\"type\":\"qidybyx\"}],\"nextLink\":\"fclhaaxdbabphlwr\"}") - .toObject(VendorNetworkFunctionListResult.class); - Assertions - .assertEquals( - VendorProvisioningState.USER_DATA_VALIDATION_FAILED, model.value().get(0).vendorProvisioningState()); - } - - @Test - public void testSerialize() { - VendorNetworkFunctionListResult model = - new VendorNetworkFunctionListResult() - .withValue( - Arrays - .asList( - new VendorNetworkFunctionInner() - .withVendorProvisioningState(VendorProvisioningState.USER_DATA_VALIDATION_FAILED) - .withNetworkFunctionVendorConfigurations(Arrays.asList()), - new VendorNetworkFunctionInner() - .withVendorProvisioningState(VendorProvisioningState.DEPROVISIONED) - .withNetworkFunctionVendorConfigurations(Arrays.asList()), - new VendorNetworkFunctionInner() - .withVendorProvisioningState(VendorProvisioningState.PROVISIONING) - .withNetworkFunctionVendorConfigurations(Arrays.asList()), - new VendorNetworkFunctionInner() - .withVendorProvisioningState(VendorProvisioningState.NOT_PROVISIONED) - .withNetworkFunctionVendorConfigurations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(VendorNetworkFunctionListResult.class); - Assertions - .assertEquals( - VendorProvisioningState.USER_DATA_VALIDATION_FAILED, model.value().get(0).vendorProvisioningState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionPropertiesFormatTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionPropertiesFormatTests.java deleted file mode 100644 index da8fae68341c..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionPropertiesFormatTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorNetworkFunctionPropertiesFormat; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.OsProfile; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorNetworkFunctionPropertiesFormatTests { - @Test - public void testDeserialize() { - VendorNetworkFunctionPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Deleted\",\"vendorProvisioningState\":\"NotProvisioned\",\"skuName\":\"fbishcbkha\",\"skuType\":\"EvolvedPacketCore\",\"networkFunctionVendorConfigurations\":[{\"roleName\":\"md\",\"osProfile\":{\"adminUsername\":\"g\",\"customData\":\"buxwgip\",\"customDataRequired\":false},\"networkInterfaces\":[]},{\"roleName\":\"gshwankixz\",\"osProfile\":{\"adminUsername\":\"jeputtmrywn\",\"customData\":\"qftiy\",\"customDataRequired\":true},\"networkInterfaces\":[]}]}") - .toObject(VendorNetworkFunctionPropertiesFormat.class); - Assertions.assertEquals(VendorProvisioningState.NOT_PROVISIONED, model.vendorProvisioningState()); - Assertions.assertEquals("md", model.networkFunctionVendorConfigurations().get(0).roleName()); - Assertions.assertEquals("g", model.networkFunctionVendorConfigurations().get(0).osProfile().adminUsername()); - Assertions.assertEquals("buxwgip", model.networkFunctionVendorConfigurations().get(0).osProfile().customData()); - Assertions - .assertEquals(false, model.networkFunctionVendorConfigurations().get(0).osProfile().customDataRequired()); - } - - @Test - public void testSerialize() { - VendorNetworkFunctionPropertiesFormat model = - new VendorNetworkFunctionPropertiesFormat() - .withVendorProvisioningState(VendorProvisioningState.NOT_PROVISIONED) - .withNetworkFunctionVendorConfigurations( - Arrays - .asList( - new NetworkFunctionVendorConfiguration() - .withRoleName("md") - .withOsProfile( - new OsProfile() - .withAdminUsername("g") - .withCustomData("buxwgip") - .withCustomDataRequired(false)) - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionVendorConfiguration() - .withRoleName("gshwankixz") - .withOsProfile( - new OsProfile() - .withAdminUsername("jeputtmrywn") - .withCustomData("qftiy") - .withCustomDataRequired(true)) - .withNetworkInterfaces(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(VendorNetworkFunctionPropertiesFormat.class); - Assertions.assertEquals(VendorProvisioningState.NOT_PROVISIONED, model.vendorProvisioningState()); - Assertions.assertEquals("md", model.networkFunctionVendorConfigurations().get(0).roleName()); - Assertions.assertEquals("g", model.networkFunctionVendorConfigurations().get(0).osProfile().adminUsername()); - Assertions.assertEquals("buxwgip", model.networkFunctionVendorConfigurations().get(0).osProfile().customData()); - Assertions - .assertEquals(false, model.networkFunctionVendorConfigurations().get(0).osProfile().customDataRequired()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateMockTests.java deleted file mode 100644 index 959b07c594d8..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorNetworkFunctionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"vendorProvisioningState\":\"UserDataValidationFailed\",\"skuName\":\"zpswiydmc\",\"skuType\":\"SDWAN\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"ss\",\"name\":\"dbzm\",\"type\":\"vdfznudaodvxzb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VendorNetworkFunction response = - manager - .vendorNetworkFunctions() - .define("ynduha") - .withExistingVendor("l", "nayqi") - .withVendorProvisioningState(VendorProvisioningState.PROVISIONING) - .withNetworkFunctionVendorConfigurations(Arrays.asList()) - .create(); - - Assertions - .assertEquals(VendorProvisioningState.USER_DATA_VALIDATION_FAILED, response.vendorProvisioningState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListMockTests.java deleted file mode 100644 index e5d77efbdbf9..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorNetworkFunctionsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.VendorNetworkFunction; -import com.azure.resourcemanager.hybridnetwork.models.VendorProvisioningState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorNetworkFunctionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"vendorProvisioningState\":\"Unknown\",\"skuName\":\"wj\",\"skuType\":\"Firewall\",\"networkFunctionVendorConfigurations\":[]},\"id\":\"ervnaenqpehi\",\"name\":\"doy\",\"type\":\"mifthnzdnd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.vendorNetworkFunctions().list("otftpvjzbexilz", "nfqqnvwp", "qtaruoujmkcjhwq", Context.NONE); - - Assertions.assertEquals(VendorProvisioningState.UNKNOWN, response.iterator().next().vendorProvisioningState()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorPropertiesFormatTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorPropertiesFormatTests.java deleted file mode 100644 index 3c850c495608..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorPropertiesFormatTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorPropertiesFormat; -import org.junit.jupiter.api.Test; - -public final class VendorPropertiesFormatTests { - @Test - public void testDeserialize() { - VendorPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Canceled\",\"skus\":[{\"id\":\"bexppb\"},{\"id\":\"q\"},{\"id\":\"ol\"},{\"id\":\"fpsalgbqu\"}]}") - .toObject(VendorPropertiesFormat.class); - } - - @Test - public void testSerialize() { - VendorPropertiesFormat model = new VendorPropertiesFormat(); - model = BinaryData.fromObject(model).toObject(VendorPropertiesFormat.class); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuInnerTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuInnerTests.java deleted file mode 100644 index c8f3c5c65ffa..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorSkuInnerTests { - @Test - public void testDeserialize() { - VendorSkuInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"skuType\":\"Firewall\",\"deploymentMode\":\"Unknown\",\"networkFunctionType\":\"VirtualNetworkFunction\",\"preview\":false,\"networkFunctionTemplate\":{\"networkFunctionRoleConfigurations\":[]}},\"id\":\"fufsrpymzi\",\"name\":\"nsez\",\"type\":\"xtbzsgfyccsne\"}") - .toObject(VendorSkuInner.class); - Assertions.assertEquals(SkuType.FIREWALL, model.skuType()); - Assertions.assertEquals(SkuDeploymentMode.UNKNOWN, model.deploymentMode()); - Assertions.assertEquals(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, model.networkFunctionType()); - Assertions.assertEquals(false, model.preview()); - } - - @Test - public void testSerialize() { - VendorSkuInner model = - new VendorSkuInner() - .withSkuType(SkuType.FIREWALL) - .withDeploymentMode(SkuDeploymentMode.UNKNOWN) - .withNetworkFunctionType(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION) - .withPreview(false) - .withNetworkFunctionTemplate( - new NetworkFunctionTemplate().withNetworkFunctionRoleConfigurations(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(VendorSkuInner.class); - Assertions.assertEquals(SkuType.FIREWALL, model.skuType()); - Assertions.assertEquals(SkuDeploymentMode.UNKNOWN, model.deploymentMode()); - Assertions.assertEquals(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, model.networkFunctionType()); - Assertions.assertEquals(false, model.preview()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuListResultTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuListResultTests.java deleted file mode 100644 index be2a785e514d..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuListResultTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuInner; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorSkuListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorSkuListResultTests { - @Test - public void testDeserialize() { - VendorSkuListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"skuType\":\"EvolvedPacketCore\",\"deploymentMode\":\"Azure\",\"networkFunctionType\":\"ContainerizedNetworkFunction\",\"preview\":false},\"id\":\"qweykhmenev\",\"name\":\"yexfwh\",\"type\":\"bcibvyvdcsitynn\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"skuType\":\"SDWAN\",\"deploymentMode\":\"Unknown\",\"networkFunctionType\":\"VirtualNetworkFunction\",\"preview\":false},\"id\":\"ypvhezrkg\",\"name\":\"hcjrefovgmk\",\"type\":\"sle\"},{\"properties\":{\"provisioningState\":\"Failed\",\"skuType\":\"Firewall\",\"deploymentMode\":\"Unknown\",\"networkFunctionType\":\"ContainerizedNetworkFunction\",\"preview\":false},\"id\":\"jcrcczsqpjhvmda\",\"name\":\"v\",\"type\":\"ysou\"}],\"nextLink\":\"e\"}") - .toObject(VendorSkuListResult.class); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.value().get(0).skuType()); - Assertions.assertEquals(SkuDeploymentMode.AZURE, model.value().get(0).deploymentMode()); - Assertions - .assertEquals( - NetworkFunctionType.CONTAINERIZED_NETWORK_FUNCTION, model.value().get(0).networkFunctionType()); - Assertions.assertEquals(false, model.value().get(0).preview()); - } - - @Test - public void testSerialize() { - VendorSkuListResult model = - new VendorSkuListResult() - .withValue( - Arrays - .asList( - new VendorSkuInner() - .withSkuType(SkuType.EVOLVED_PACKET_CORE) - .withDeploymentMode(SkuDeploymentMode.AZURE) - .withNetworkFunctionType(NetworkFunctionType.CONTAINERIZED_NETWORK_FUNCTION) - .withPreview(false), - new VendorSkuInner() - .withSkuType(SkuType.SDWAN) - .withDeploymentMode(SkuDeploymentMode.UNKNOWN) - .withNetworkFunctionType(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION) - .withPreview(false), - new VendorSkuInner() - .withSkuType(SkuType.FIREWALL) - .withDeploymentMode(SkuDeploymentMode.UNKNOWN) - .withNetworkFunctionType(NetworkFunctionType.CONTAINERIZED_NETWORK_FUNCTION) - .withPreview(false))); - model = BinaryData.fromObject(model).toObject(VendorSkuListResult.class); - Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.value().get(0).skuType()); - Assertions.assertEquals(SkuDeploymentMode.AZURE, model.value().get(0).deploymentMode()); - Assertions - .assertEquals( - NetworkFunctionType.CONTAINERIZED_NETWORK_FUNCTION, model.value().get(0).networkFunctionType()); - Assertions.assertEquals(false, model.value().get(0).preview()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsCreateOrUpdateMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsCreateOrUpdateMockTests.java deleted file mode 100644 index 43c53aa161a8..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkuPreviewsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"hzxct\",\"name\":\"bgbkdmoizpost\",\"type\":\"grcfb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PreviewSubscription response = - manager.vendorSkuPreviews().define("t").withExistingVendorSku("wwncwzzhxgk", "rmgucnap").create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsDeleteMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsDeleteMockTests.java deleted file mode 100644 index 6aa390561528..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkuPreviewsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.vendorSkuPreviews().delete("gvpgy", "gqgitxmedjvcsl", "n", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsListMockTests.java deleted file mode 100644 index 8a92b7833018..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPreviewsListMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.PreviewSubscription; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkuPreviewsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"hnrztfol\",\"name\":\"bnxknalaulppg\",\"type\":\"dtpnapnyiropuhp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.vendorSkuPreviews().list("sxyawjoyaqcs", "yjpkiidzyexz", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPropertiesFormatTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPropertiesFormatTests.java deleted file mode 100644 index eb53eb591103..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkuPropertiesFormatTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorSkuPropertiesFormat; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfiguration; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionRoleConfigurationType; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VirtualMachineSizeTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VendorSkuPropertiesFormatTests { - @Test - public void testDeserialize() { - VendorSkuPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"skuType\":\"Unknown\",\"deploymentMode\":\"PrivateEdgeZone\",\"networkFunctionType\":\"Unknown\",\"preview\":false,\"networkFunctionTemplate\":{\"networkFunctionRoleConfigurations\":[{\"roleName\":\"nrosfqpte\",\"roleType\":\"VirtualMachine\",\"virtualMachineSize\":\"Standard_D13_v2\",\"networkInterfaces\":[]},{\"roleName\":\"z\",\"roleType\":\"VirtualMachine\",\"virtualMachineSize\":\"Standard_F2\",\"networkInterfaces\":[]},{\"roleName\":\"oodqxhcrm\",\"roleType\":\"Unknown\",\"virtualMachineSize\":\"Standard_F1s\",\"networkInterfaces\":[]},{\"roleName\":\"ifiyipjxsqwpgrj\",\"roleType\":\"VirtualMachine\",\"virtualMachineSize\":\"Standard_D3_v2\",\"networkInterfaces\":[]}]}}") - .toObject(VendorSkuPropertiesFormat.class); - Assertions.assertEquals(SkuType.UNKNOWN, model.skuType()); - Assertions.assertEquals(SkuDeploymentMode.PRIVATE_EDGE_ZONE, model.deploymentMode()); - Assertions.assertEquals(NetworkFunctionType.UNKNOWN, model.networkFunctionType()); - Assertions.assertEquals(false, model.preview()); - Assertions - .assertEquals( - "nrosfqpte", model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).roleName()); - Assertions - .assertEquals( - NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE, - model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).roleType()); - Assertions - .assertEquals( - VirtualMachineSizeTypes.STANDARD_D13_V2, - model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).virtualMachineSize()); - } - - @Test - public void testSerialize() { - VendorSkuPropertiesFormat model = - new VendorSkuPropertiesFormat() - .withSkuType(SkuType.UNKNOWN) - .withDeploymentMode(SkuDeploymentMode.PRIVATE_EDGE_ZONE) - .withNetworkFunctionType(NetworkFunctionType.UNKNOWN) - .withPreview(false) - .withNetworkFunctionTemplate( - new NetworkFunctionTemplate() - .withNetworkFunctionRoleConfigurations( - Arrays - .asList( - new NetworkFunctionRoleConfiguration() - .withRoleName("nrosfqpte") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D13_V2) - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionRoleConfiguration() - .withRoleName("z") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_F2) - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionRoleConfiguration() - .withRoleName("oodqxhcrm") - .withRoleType(NetworkFunctionRoleConfigurationType.UNKNOWN) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_F1S) - .withNetworkInterfaces(Arrays.asList()), - new NetworkFunctionRoleConfiguration() - .withRoleName("ifiyipjxsqwpgrj") - .withRoleType(NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE) - .withVirtualMachineSize(VirtualMachineSizeTypes.STANDARD_D3_V2) - .withNetworkInterfaces(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(VendorSkuPropertiesFormat.class); - Assertions.assertEquals(SkuType.UNKNOWN, model.skuType()); - Assertions.assertEquals(SkuDeploymentMode.PRIVATE_EDGE_ZONE, model.deploymentMode()); - Assertions.assertEquals(NetworkFunctionType.UNKNOWN, model.networkFunctionType()); - Assertions.assertEquals(false, model.preview()); - Assertions - .assertEquals( - "nrosfqpte", model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).roleName()); - Assertions - .assertEquals( - NetworkFunctionRoleConfigurationType.VIRTUAL_MACHINE, - model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).roleType()); - Assertions - .assertEquals( - VirtualMachineSizeTypes.STANDARD_D13_V2, - model.networkFunctionTemplate().networkFunctionRoleConfigurations().get(0).virtualMachineSize()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateMockTests.java deleted file mode 100644 index 673ac9dd4619..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusCreateOrUpdateMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionTemplate; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorSku; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkusCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"skuType\":\"Firewall\",\"deploymentMode\":\"Unknown\",\"networkFunctionType\":\"VirtualNetworkFunction\",\"preview\":false,\"networkFunctionTemplate\":{\"networkFunctionRoleConfigurations\":[]}},\"id\":\"v\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VendorSku response = - manager - .vendorSkus() - .define("xipeilpjzuaejx") - .withExistingVendor("hnnpr") - .withSkuType(SkuType.EVOLVED_PACKET_CORE) - .withDeploymentMode(SkuDeploymentMode.UNKNOWN) - .withNetworkFunctionType(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION) - .withPreview(true) - .withNetworkFunctionTemplate( - new NetworkFunctionTemplate().withNetworkFunctionRoleConfigurations(Arrays.asList())) - .create(); - - Assertions.assertEquals(SkuType.FIREWALL, response.skuType()); - Assertions.assertEquals(SkuDeploymentMode.UNKNOWN, response.deploymentMode()); - Assertions.assertEquals(NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, response.networkFunctionType()); - Assertions.assertEquals(false, response.preview()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteMockTests.java deleted file mode 100644 index fd91025d4ced..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkusDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.vendorSkus().delete("qtayri", "wroyqbexrmcq", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListMockTests.java deleted file mode 100644 index 93ef8cc960d8..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorSkusListMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionType; -import com.azure.resourcemanager.hybridnetwork.models.SkuDeploymentMode; -import com.azure.resourcemanager.hybridnetwork.models.SkuType; -import com.azure.resourcemanager.hybridnetwork.models.VendorSku; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorSkusListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"skuType\":\"Unknown\",\"deploymentMode\":\"Azure\",\"networkFunctionType\":\"VirtualNetworkFunction\",\"preview\":false,\"networkFunctionTemplate\":{\"networkFunctionRoleConfigurations\":[]}},\"id\":\"vgqzcjrvxd\",\"name\":\"zlmwlxkvugfhz\",\"type\":\"vawjvzunlu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.vendorSkus().list("bycnojvkn", Context.NONE); - - Assertions.assertEquals(SkuType.UNKNOWN, response.iterator().next().skuType()); - Assertions.assertEquals(SkuDeploymentMode.AZURE, response.iterator().next().deploymentMode()); - Assertions - .assertEquals( - NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, response.iterator().next().networkFunctionType()); - Assertions.assertEquals(false, response.iterator().next().preview()); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateMockTests.java deleted file mode 100644 index c11d1a90d546..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Vendor; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"skus\":[]},\"id\":\"mhtxongmtsavjcb\",\"name\":\"wxqpsrknftguvri\",\"type\":\"hprwmdyv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Vendor response = manager.vendors().define("fgb").create(); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteMockTests.java deleted file mode 100644 index f3872fdfa620..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.vendors().delete("uwprzql", Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListMockTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListMockTests.java deleted file mode 100644 index dfa57681f631..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VendorsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridnetwork.HybridNetworkManager; -import com.azure.resourcemanager.hybridnetwork.models.Vendor; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VendorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"skus\":[]},\"id\":\"j\",\"name\":\"khfxobbcswsrt\",\"type\":\"riplrbpbewtg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridNetworkManager manager = - HybridNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.vendors().list(Context.NONE); - } -} diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VirtualHardDiskTests.java b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VirtualHardDiskTests.java deleted file mode 100644 index f04cd830991b..000000000000 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/test/java/com/azure/resourcemanager/hybridnetwork/generated/VirtualHardDiskTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridnetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VirtualHardDiskTests { - @Test - public void testDeserialize() { - VirtualHardDisk model = BinaryData.fromString("{\"uri\":\"orxzdmohctbqvud\"}").toObject(VirtualHardDisk.class); - Assertions.assertEquals("orxzdmohctbqvud", model.uri()); - } - - @Test - public void testSerialize() { - VirtualHardDisk model = new VirtualHardDisk().withUri("orxzdmohctbqvud"); - model = BinaryData.fromObject(model).toObject(VirtualHardDisk.class); - Assertions.assertEquals("orxzdmohctbqvud", model.uri()); - } -}