From 0626802a524a3f08c4222a8d64c71855f4acf884 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:17:22 -0800 Subject: [PATCH] [Automation] Generate Fluent Lite from Swagger extendedlocation#package-2021-08-15 (#43681) --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 10 +- .../README.md | 4 +- .../SAMPLE.md | 246 +--- .../pom.xml | 6 +- .../CustomLocationsManager.java | 22 +- .../fluent/CustomLocationsClient.java | 40 - .../CustomLocationsManagementClient.java | 7 - .../fluent/ResourceSyncRulesClient.java | 281 ---- ...ionFindTargetResourceGroupResultInner.java | 109 -- .../fluent/models/ResourceSyncRuleInner.java | 279 ---- .../models/ResourceSyncRuleProperties.java | 203 --- ...tionFindTargetResourceGroupResultImpl.java | 37 - .../implementation/CustomLocationImpl.java | 14 - .../CustomLocationsClientImpl.java | 170 --- .../implementation/CustomLocationsImpl.java | 27 - .../CustomLocationsManagementClientImpl.java | 18 +- .../implementation/ResourceSyncRuleImpl.java | 220 --- .../ResourceSyncRulesClientImpl.java | 1211 ----------------- .../implementation/ResourceSyncRulesImpl.java | 160 --- .../models/CustomLocation.java | 32 - ...tionFindTargetResourceGroupProperties.java | 97 -- ...LocationFindTargetResourceGroupResult.java | 38 - .../models/CustomLocations.java | 35 - .../models/MatchExpressionsProperties.java | 154 --- .../models/PatchableResourceSyncRule.java | 214 --- .../models/ResourceSyncRule.java | 397 ------ .../models/ResourceSyncRuleListResult.java | 104 -- .../ResourceSyncRulePropertiesSelector.java | 149 -- .../models/ResourceSyncRules.java | 184 --- .../proxy-config.json | 2 +- .../CustomLocationsCreateOrUpdateSamples.java | 2 +- .../CustomLocationsDeleteSamples.java | 2 +- ...cationsFindTargetResourceGroupSamples.java | 45 - ...tomLocationsGetByResourceGroupSamples.java | 2 +- ...omLocationsListByResourceGroupSamples.java | 2 +- ...ationsListEnabledResourceTypesSamples.java | 2 +- .../CustomLocationsListOperationsSamples.java | 2 +- .../generated/CustomLocationsListSamples.java | 2 +- .../CustomLocationsUpdateSamples.java | 2 +- ...esourceSyncRulesCreateOrUpdateSamples.java | 55 - .../ResourceSyncRulesDeleteSamples.java | 27 - .../ResourceSyncRulesGetSamples.java | 26 - ...yncRulesListByCustomLocationIdSamples.java | 26 - .../ResourceSyncRulesUpdateSamples.java | 48 - ...indTargetResourceGroupPropertiesTests.java | 42 - ...ndTargetResourceGroupResultInnerTests.java | 23 - ...ustomLocationsCreateOrUpdateMockTests.java | 44 +- ...getResourceGroupWithResponseMockTests.java | 54 - ...tByResourceGroupWithResponseMockTests.java | 22 +- ...LocationsListByResourceGroupMockTests.java | 22 +- ...ionsListEnabledResourceTypesMockTests.java | 14 +- .../CustomLocationsListMockTests.java | 22 +- ...ustomLocationsListOperationsMockTests.java | 2 +- .../ResourceSyncRuleListResultTests.java | 23 - ...eSyncRulesDeleteWithResponseMockTests.java | 34 - 56 files changed, 95 insertions(+), 4922 deletions(-) delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/ResourceSyncRulesClient.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationFindTargetResourceGroupResultInner.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleInner.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleProperties.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationFindTargetResourceGroupResultImpl.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRuleImpl.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesClientImpl.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesImpl.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupProperties.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupResult.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/MatchExpressionsProperties.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableResourceSyncRule.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRule.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRuleListResult.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRulePropertiesSelector.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRules.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesCreateOrUpdateSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesGetSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesListByCustomLocationIdSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesUpdateSamples.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupPropertiesTests.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupResultInnerTests.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupWithResponseMockTests.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRuleListResultTests.java delete mode 100644 sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteWithResponseMockTests.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 4434c46e1d1cf..57b84c71b05f7 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -386,7 +386,7 @@ com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.6;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-quota;1.0.0;1.1.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.3;1.0.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.3;1.0.0 com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.3.0;1.4.0-beta.1 diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md index 65d981b66ece6..c45626e4f2e30 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0 (2025-01-03) -### Features Added - -### Breaking Changes - -### Bugs Fixed +- Azure Resource Manager CustomLocations client library for Java. This package contains Microsoft Azure SDK for CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Other Changes +- Release for Azure Resource Manager CustomLocations client library for Java. + ## 1.0.0-beta.3 (2024-10-10) - Azure Resource Manager CustomLocations client library for Java. This package contains Microsoft Azure SDK for CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-31-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md index d3c2de956e568..642db9fe4a8f1 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md @@ -2,7 +2,7 @@ Azure Resource Manager CustomLocations client library for Java. -This package contains Microsoft Azure SDK for CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-31-preview. 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 CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-15. 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-extendedlocation - 1.0.0-beta.3 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/SAMPLE.md b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/SAMPLE.md index 886ece996c672..fec29d4e68bf2 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/SAMPLE.md +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/SAMPLE.md @@ -5,21 +5,12 @@ - [CreateOrUpdate](#customlocations_createorupdate) - [Delete](#customlocations_delete) -- [FindTargetResourceGroup](#customlocations_findtargetresourcegroup) - [GetByResourceGroup](#customlocations_getbyresourcegroup) - [List](#customlocations_list) - [ListByResourceGroup](#customlocations_listbyresourcegroup) - [ListEnabledResourceTypes](#customlocations_listenabledresourcetypes) - [ListOperations](#customlocations_listoperations) - [Update](#customlocations_update) - -## ResourceSyncRules - -- [CreateOrUpdate](#resourcesyncrules_createorupdate) -- [Delete](#resourcesyncrules_delete) -- [Get](#resourcesyncrules_get) -- [ListByCustomLocationId](#resourcesyncrules_listbycustomlocationid) -- [Update](#resourcesyncrules_update) ### CustomLocations_CreateOrUpdate ```java @@ -34,7 +25,7 @@ import java.util.Arrays; public final class CustomLocationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsCreate_Update.json */ /** @@ -71,7 +62,7 @@ public final class CustomLocationsCreateOrUpdateSamples { public final class CustomLocationsDeleteSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsDelete.json */ /** @@ -85,50 +76,6 @@ public final class CustomLocationsDeleteSamples { } ``` -### CustomLocations_FindTargetResourceGroup - -```java -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CustomLocations FindTargetResourceGroup. - */ -public final class CustomLocationsFindTargetResourceGroupSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * CustomLocationsFindTargetResourceGroup.json - */ - /** - * Sample code: Post Custom Location Find Target Resource Group. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void postCustomLocationFindTargetResourceGroup( - com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.customLocations() - .findTargetResourceGroupWithResponse("testresourcegroup", "customLocation01", - new CustomLocationFindTargetResourceGroupProperties() - .withLabels(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")), - com.azure.core.util.Context.NONE); - } - - // 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; - } -} -``` - ### CustomLocations_GetByResourceGroup ```java @@ -138,7 +85,7 @@ public final class CustomLocationsFindTargetResourceGroupSamples { public final class CustomLocationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsGet.json */ /** @@ -162,7 +109,7 @@ public final class CustomLocationsGetByResourceGroupSamples { public final class CustomLocationsListSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListBySubscription.json */ /** @@ -186,7 +133,7 @@ public final class CustomLocationsListSamples { public final class CustomLocationsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListByResourceGroup.json */ /** @@ -210,7 +157,7 @@ public final class CustomLocationsListByResourceGroupSamples { public final class CustomLocationsListEnabledResourceTypesSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListEnabledResourceTypes.json */ /** @@ -234,7 +181,7 @@ public final class CustomLocationsListEnabledResourceTypesSamples { public final class CustomLocationsListOperationsSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListOperations.json */ /** @@ -265,7 +212,7 @@ import java.util.Map; public final class CustomLocationsUpdateSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsPatch.json */ /** @@ -300,180 +247,3 @@ public final class CustomLocationsUpdateSamples { } ``` -### ResourceSyncRules_CreateOrUpdate - -```java -import com.azure.resourcemanager.extendedlocation.models.MatchExpressionsProperties; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRulePropertiesSelector; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for ResourceSyncRules CreateOrUpdate. - */ -public final class ResourceSyncRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesCreate_Update.json - */ - /** - * Sample code: Create/Update Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - createUpdateResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .define("resourceSyncRule01") - .withRegion("West US") - .withExistingCustomLocation("testresourcegroup", "customLocation01") - .withPriority(999) - .withSelector(new ResourceSyncRulePropertiesSelector() - .withMatchExpressions(Arrays.asList(new MatchExpressionsProperties().withKey("fakeTokenPlaceholder") - .withOperator("In") - .withValues(Arrays.asList("value4")))) - .withMatchLabels(mapOf("key1", "fakeTokenPlaceholder"))) - .withTargetResourceGroup( - "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup") - .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; - } -} -``` - -### ResourceSyncRules_Delete - -```java -/** - * Samples for ResourceSyncRules Delete. - */ -public final class ResourceSyncRulesDeleteSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesDelete.json - */ - /** - * Sample code: Delete Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - deleteResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .deleteWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE); - } -} -``` - -### ResourceSyncRules_Get - -```java -/** - * Samples for ResourceSyncRules Get. - */ -public final class ResourceSyncRulesGetSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesGet.json - */ - /** - * Sample code: Get Custom Location. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void getCustomLocation(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .getWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE); - } -} -``` - -### ResourceSyncRules_ListByCustomLocationId - -```java -/** - * Samples for ResourceSyncRules ListByCustomLocationId. - */ -public final class ResourceSyncRulesListByCustomLocationIdSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesListByCustomLocationID.json - */ - /** - * Sample code: List Resource Sync Rules by subscription. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - listResourceSyncRulesBySubscription(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .listByCustomLocationId("testresourcegroup", "customLocation01", com.azure.core.util.Context.NONE); - } -} -``` - -### ResourceSyncRules_Update - -```java -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRule; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for ResourceSyncRules Update. - */ -public final class ResourceSyncRulesUpdateSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesPatch.json - */ - /** - * Sample code: Update Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - updateResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - ResourceSyncRule resource = manager.resourceSyncRules() - .getWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tier", "testing")) - .withTargetResourceGroup("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testrg/") - .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/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml index 0cb6dee4c8e27..e23f861e39def 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-extendedlocation - 1.0.0-beta.4 + 1.0.0 jar Microsoft Azure SDK for CustomLocations Management - This package contains Microsoft Azure SDK for CustomLocations Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The customLocations Rest API spec. Package tag package-2021-08-31-preview. + This package contains Microsoft Azure SDK for CustomLocations Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The customLocations Rest API spec. Package tag package-2021-08-15. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - true + false diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java index 9358a9731ce45..762c0561a27d9 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java @@ -11,6 +11,7 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,16 +20,13 @@ import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsManagementClient; import com.azure.resourcemanager.extendedlocation.implementation.CustomLocationsImpl; import com.azure.resourcemanager.extendedlocation.implementation.CustomLocationsManagementClientBuilder; -import com.azure.resourcemanager.extendedlocation.implementation.ResourceSyncRulesImpl; import com.azure.resourcemanager.extendedlocation.models.CustomLocations; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRules; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -43,8 +41,6 @@ public final class CustomLocationsManager { private CustomLocations customLocations; - private ResourceSyncRules resourceSyncRules; - private final CustomLocationsManagementClient clientObject; private CustomLocationsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -209,7 +205,7 @@ public CustomLocationsManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.extendedlocation") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -242,7 +238,7 @@ public CustomLocationsManager authenticate(TokenCredential credential, AzureProf HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); @@ -267,18 +263,6 @@ public CustomLocations customLocations() { return customLocations; } - /** - * Gets the resource collection API of ResourceSyncRules. It manages ResourceSyncRule. - * - * @return Resource collection API of ResourceSyncRules. - */ - public ResourceSyncRules resourceSyncRules() { - if (this.resourceSyncRules == null) { - this.resourceSyncRules = new ResourceSyncRulesImpl(clientObject.getResourceSyncRules(), this); - } - return resourceSyncRules; - } - /** * Gets wrapped service client CustomLocationsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java index 5e62fac95f6c9..d1043732eb143 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java @@ -11,11 +11,9 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationOperationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.EnabledResourceTypeInner; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; import com.azure.resourcemanager.extendedlocation.models.PatchableCustomLocations; /** @@ -333,42 +331,4 @@ Response updateWithResponse(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listEnabledResourceTypes(String resourceGroupName, String resourceName, Context context); - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response findTargetResourceGroupWithResponse( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties parameters, - Context context); - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomLocationFindTargetResourceGroupResultInner findTargetResourceGroup(String resourceGroupName, - String resourceName, CustomLocationFindTargetResourceGroupProperties parameters); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsManagementClient.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsManagementClient.java index c739273e79f52..2a516dd04e0b3 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsManagementClient.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsManagementClient.java @@ -52,11 +52,4 @@ public interface CustomLocationsManagementClient { * @return the CustomLocationsClient object. */ CustomLocationsClient getCustomLocations(); - - /** - * Gets the ResourceSyncRulesClient object to access its operations. - * - * @return the ResourceSyncRulesClient object. - */ - ResourceSyncRulesClient getResourceSyncRules(); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/ResourceSyncRulesClient.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/ResourceSyncRulesClient.java deleted file mode 100644 index a0069dfa189fd..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/ResourceSyncRulesClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.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.extendedlocation.fluent.models.ResourceSyncRuleInner; -import com.azure.resourcemanager.extendedlocation.models.PatchableResourceSyncRule; - -/** - * An instance of this class provides access to all the operations defined in ResourceSyncRulesClient. - */ -public interface ResourceSyncRulesClient { - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName); - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName, - Context context); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceSyncRuleInner get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ResourceSyncRuleInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, String childResourceName, ResourceSyncRuleInner parameters); - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ResourceSyncRuleInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, String childResourceName, ResourceSyncRuleInner parameters, Context context); - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceSyncRuleInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - ResourceSyncRuleInner parameters); - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceSyncRuleInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - ResourceSyncRuleInner parameters, Context context); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ResourceSyncRuleInner> beginUpdate(String resourceGroupName, - String resourceName, String childResourceName, PatchableResourceSyncRule parameters); - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ResourceSyncRuleInner> beginUpdate(String resourceGroupName, - String resourceName, String childResourceName, PatchableResourceSyncRule parameters, Context context); - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceSyncRuleInner update(String resourceGroupName, String resourceName, String childResourceName, - PatchableResourceSyncRule parameters); - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceSyncRuleInner update(String resourceGroupName, String resourceName, String childResourceName, - PatchableResourceSyncRule parameters, Context context); -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationFindTargetResourceGroupResultInner.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationFindTargetResourceGroupResultInner.java deleted file mode 100644 index 56015ace0dc60..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationFindTargetResourceGroupResultInner.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.extendedlocation.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Find Target Resource Group operation response. - */ -@Immutable -public final class CustomLocationFindTargetResourceGroupResultInner - implements JsonSerializable { - /* - * The matching resource sync rule is the particular resource sync rule that matched the match expressions and - * labels and had lowest priority. This is the rule responsible for mapping the target resource to the target - * resource group. - */ - private String matchedResourceSyncRule; - - /* - * The target resource group of matching resource sync rule. The labels from the request will be used to find out - * matching resource sync rule against the selector property of the resource sync rule. The one with highest - * priority will be returned if there are multiple matching rules. - */ - private String targetResourceGroup; - - /** - * Creates an instance of CustomLocationFindTargetResourceGroupResultInner class. - */ - public CustomLocationFindTargetResourceGroupResultInner() { - } - - /** - * Get the matchedResourceSyncRule property: The matching resource sync rule is the particular resource sync rule - * that matched the match expressions and labels and had lowest priority. This is the rule responsible for mapping - * the target resource to the target resource group. - * - * @return the matchedResourceSyncRule value. - */ - public String matchedResourceSyncRule() { - return this.matchedResourceSyncRule; - } - - /** - * Get the targetResourceGroup property: The target resource group of matching resource sync rule. The labels from - * the request will be used to find out matching resource sync rule against the selector property of the resource - * sync rule. The one with highest priority will be returned if there are multiple matching rules. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.targetResourceGroup; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomLocationFindTargetResourceGroupResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomLocationFindTargetResourceGroupResultInner if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomLocationFindTargetResourceGroupResultInner. - */ - public static CustomLocationFindTargetResourceGroupResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomLocationFindTargetResourceGroupResultInner deserializedCustomLocationFindTargetResourceGroupResultInner - = new CustomLocationFindTargetResourceGroupResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("matchedResourceSyncRule".equals(fieldName)) { - deserializedCustomLocationFindTargetResourceGroupResultInner.matchedResourceSyncRule - = reader.getString(); - } else if ("targetResourceGroup".equals(fieldName)) { - deserializedCustomLocationFindTargetResourceGroupResultInner.targetResourceGroup - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomLocationFindTargetResourceGroupResultInner; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleInner.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleInner.java deleted file mode 100644 index 2ab7722b0105c..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleInner.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRulePropertiesSelector; -import java.io.IOException; -import java.util.Map; - -/** - * Resource Sync Rules definition. - */ -@Fluent -public final class ResourceSyncRuleInner extends Resource { - /* - * The set of properties specific to a Resource Sync Rule - */ - private ResourceSyncRuleProperties innerProperties; - - /* - * Metadata pertaining to creation and last modification of the resource - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ResourceSyncRuleInner class. - */ - public ResourceSyncRuleInner() { - } - - /** - * Get the innerProperties property: The set of properties specific to a Resource Sync Rule. - * - * @return the innerProperties value. - */ - private ResourceSyncRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceSyncRuleInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceSyncRuleInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @param priority the priority value to set. - * @return the ResourceSyncRuleInner object itself. - */ - public ResourceSyncRuleInner withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the provisioningState property: Provisioning State for the Resource Sync Rule. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @return the selector value. - */ - public ResourceSyncRulePropertiesSelector selector() { - return this.innerProperties() == null ? null : this.innerProperties().selector(); - } - - /** - * Set the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @param selector the selector value to set. - * @return the ResourceSyncRuleInner object itself. - */ - public ResourceSyncRuleInner withSelector(ResourceSyncRulePropertiesSelector selector) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withSelector(selector); - return this; - } - - /** - * Get the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().targetResourceGroup(); - } - - /** - * Set the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the ResourceSyncRuleInner object itself. - */ - public ResourceSyncRuleInner withTargetResourceGroup(String targetResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withTargetResourceGroup(targetResourceGroup); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSyncRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSyncRuleInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ResourceSyncRuleInner. - */ - public static ResourceSyncRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSyncRuleInner deserializedResourceSyncRuleInner = new ResourceSyncRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedResourceSyncRuleInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedResourceSyncRuleInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedResourceSyncRuleInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedResourceSyncRuleInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedResourceSyncRuleInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedResourceSyncRuleInner.innerProperties = ResourceSyncRuleProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedResourceSyncRuleInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSyncRuleInner; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleProperties.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleProperties.java deleted file mode 100644 index cb21a446ad51a..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/ResourceSyncRuleProperties.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRulePropertiesSelector; -import java.io.IOException; - -/** - * Properties for a resource sync rule. For an unmapped custom resource, its labels will be used to find out matching - * resource sync rules using the selector property of the resource sync rule. If this resource sync rule has highest - * priority among all matching rules, then the unmapped custom resource will be projected to the target resource group - * associated with this resource sync rule. - */ -@Fluent -public final class ResourceSyncRuleProperties implements JsonSerializable { - /* - * Priority represents a priority of the Resource Sync Rule - */ - private Integer priority; - - /* - * Provisioning State for the Resource Sync Rule. - */ - private String provisioningState; - - /* - * A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map - * of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of - * matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The - * second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, - * Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be - * empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions - * must all be satisfied in order to match. - */ - private ResourceSyncRulePropertiesSelector selector; - - /* - * For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource - * sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected - * to the target resource group associated with this resource sync rule. The user creating this resource sync rule - * should have write permissions on the target resource group and this write permission will be validated when - * creating the resource sync rule. - */ - private String targetResourceGroup; - - /** - * Creates an instance of ResourceSyncRuleProperties class. - */ - public ResourceSyncRuleProperties() { - } - - /** - * Get the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @param priority the priority value to set. - * @return the ResourceSyncRuleProperties object itself. - */ - public ResourceSyncRuleProperties withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the provisioningState property: Provisioning State for the Resource Sync Rule. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @return the selector value. - */ - public ResourceSyncRulePropertiesSelector selector() { - return this.selector; - } - - /** - * Set the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @param selector the selector value to set. - * @return the ResourceSyncRuleProperties object itself. - */ - public ResourceSyncRuleProperties withSelector(ResourceSyncRulePropertiesSelector selector) { - this.selector = selector; - return this; - } - - /** - * Get the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.targetResourceGroup; - } - - /** - * Set the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the ResourceSyncRuleProperties object itself. - */ - public ResourceSyncRuleProperties withTargetResourceGroup(String targetResourceGroup) { - this.targetResourceGroup = targetResourceGroup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (selector() != null) { - selector().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("priority", this.priority); - jsonWriter.writeJsonField("selector", this.selector); - jsonWriter.writeStringField("targetResourceGroup", this.targetResourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSyncRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSyncRuleProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceSyncRuleProperties. - */ - public static ResourceSyncRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSyncRuleProperties deserializedResourceSyncRuleProperties = new ResourceSyncRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("priority".equals(fieldName)) { - deserializedResourceSyncRuleProperties.priority = reader.getNullable(JsonReader::getInt); - } else if ("provisioningState".equals(fieldName)) { - deserializedResourceSyncRuleProperties.provisioningState = reader.getString(); - } else if ("selector".equals(fieldName)) { - deserializedResourceSyncRuleProperties.selector - = ResourceSyncRulePropertiesSelector.fromJson(reader); - } else if ("targetResourceGroup".equals(fieldName)) { - deserializedResourceSyncRuleProperties.targetResourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSyncRuleProperties; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationFindTargetResourceGroupResultImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationFindTargetResourceGroupResultImpl.java deleted file mode 100644 index 6844ec629bf82..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationFindTargetResourceGroupResultImpl.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.extendedlocation.implementation; - -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupResult; - -public final class CustomLocationFindTargetResourceGroupResultImpl - implements CustomLocationFindTargetResourceGroupResult { - private CustomLocationFindTargetResourceGroupResultInner innerObject; - - private final com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager; - - CustomLocationFindTargetResourceGroupResultImpl(CustomLocationFindTargetResourceGroupResultInner innerObject, - com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String matchedResourceSyncRule() { - return this.innerModel().matchedResourceSyncRule(); - } - - public String targetResourceGroup() { - return this.innerModel().targetResourceGroup(); - } - - public CustomLocationFindTargetResourceGroupResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java index bc634eef5587c..1ff2554a5cc25 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java @@ -4,14 +4,11 @@ package com.azure.resourcemanager.extendedlocation.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.extendedlocation.fluent.models.CustomLocationInner; import com.azure.resourcemanager.extendedlocation.models.CustomLocation; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupResult; import com.azure.resourcemanager.extendedlocation.models.CustomLocationPropertiesAuthentication; import com.azure.resourcemanager.extendedlocation.models.HostType; import com.azure.resourcemanager.extendedlocation.models.Identity; @@ -187,17 +184,6 @@ public CustomLocation refresh(Context context) { return this; } - public Response findTargetResourceGroupWithResponse( - CustomLocationFindTargetResourceGroupProperties parameters, Context context) { - return serviceManager.customLocations() - .findTargetResourceGroupWithResponse(resourceGroupName, resourceName, parameters, context); - } - - public CustomLocationFindTargetResourceGroupResult - findTargetResourceGroup(CustomLocationFindTargetResourceGroupProperties parameters) { - return serviceManager.customLocations().findTargetResourceGroup(resourceGroupName, resourceName, parameters); - } - public CustomLocationImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java index a7c14079dc1d7..ea77373352036 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.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; @@ -34,11 +33,9 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsClient; -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationOperationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.EnabledResourceTypeInner; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; import com.azure.resourcemanager.extendedlocation.models.CustomLocationListResult; import com.azure.resourcemanager.extendedlocation.models.CustomLocationOperationsList; import com.azure.resourcemanager.extendedlocation.models.EnabledResourceTypesListResult; @@ -150,17 +147,6 @@ Mono> listEnabledResourceTypes(@HostPar @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> findTargetResourceGroup( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") CustomLocationFindTargetResourceGroupProperties parameters, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1477,162 +1463,6 @@ public PagedIterable listEnabledResourceTypes(String r return new PagedIterable<>(listEnabledResourceTypesAsync(resourceGroupName, resourceName, context)); } - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> findTargetResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.findTargetResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> findTargetResourceGroupWithResponseAsync( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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.findTargetResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); - } - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono findTargetResourceGroupAsync( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties parameters) { - return findTargetResourceGroupWithResponseAsync(resourceGroupName, resourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response findTargetResourceGroupWithResponse( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties parameters, - Context context) { - return findTargetResourceGroupWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); - } - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomLocationFindTargetResourceGroupResultInner findTargetResourceGroup(String resourceGroupName, - String resourceName, CustomLocationFindTargetResourceGroupProperties parameters) { - return findTargetResourceGroupWithResponse(resourceGroupName, resourceName, parameters, Context.NONE) - .getValue(); - } - /** * Get the next page of items. * diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java index f20d2616626f0..74e489239469f 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java @@ -10,13 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsClient; -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationOperationInner; import com.azure.resourcemanager.extendedlocation.fluent.models.EnabledResourceTypeInner; import com.azure.resourcemanager.extendedlocation.models.CustomLocation; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupResult; import com.azure.resourcemanager.extendedlocation.models.CustomLocationOperation; import com.azure.resourcemanager.extendedlocation.models.CustomLocations; import com.azure.resourcemanager.extendedlocation.models.EnabledResourceType; @@ -106,30 +103,6 @@ public PagedIterable listEnabledResourceTypes(String resour return ResourceManagerUtils.mapPage(inner, inner1 -> new EnabledResourceTypeImpl(inner1, this.manager())); } - public Response findTargetResourceGroupWithResponse( - String resourceGroupName, String resourceName, CustomLocationFindTargetResourceGroupProperties parameters, - Context context) { - Response inner = this.serviceClient() - .findTargetResourceGroupWithResponse(resourceGroupName, resourceName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomLocationFindTargetResourceGroupResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CustomLocationFindTargetResourceGroupResult findTargetResourceGroup(String resourceGroupName, - String resourceName, CustomLocationFindTargetResourceGroupProperties parameters) { - CustomLocationFindTargetResourceGroupResultInner inner - = this.serviceClient().findTargetResourceGroup(resourceGroupName, resourceName, parameters); - if (inner != null) { - return new CustomLocationFindTargetResourceGroupResultImpl(inner, this.manager()); - } else { - return null; - } - } - public CustomLocation getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java index e7543b21e1a01..36ffdac684720 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsClient; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsManagementClient; -import com.azure.resourcemanager.extendedlocation.fluent.ResourceSyncRulesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -138,20 +137,6 @@ public CustomLocationsClient getCustomLocations() { return this.customLocations; } - /** - * The ResourceSyncRulesClient object to access its operations. - */ - private final ResourceSyncRulesClient resourceSyncRules; - - /** - * Gets the ResourceSyncRulesClient object to access its operations. - * - * @return the ResourceSyncRulesClient object. - */ - public ResourceSyncRulesClient getResourceSyncRules() { - return this.resourceSyncRules; - } - /** * Initializes an instance of CustomLocationsManagementClient client. * @@ -169,9 +154,8 @@ public ResourceSyncRulesClient getResourceSyncRules() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-08-31-preview"; + this.apiVersion = "2021-08-15"; this.customLocations = new CustomLocationsClientImpl(this); - this.resourceSyncRules = new ResourceSyncRulesClientImpl(this); } /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRuleImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRuleImpl.java deleted file mode 100644 index 2736c0069d592..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRuleImpl.java +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner; -import com.azure.resourcemanager.extendedlocation.models.PatchableResourceSyncRule; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRule; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRulePropertiesSelector; -import java.util.Collections; -import java.util.Map; - -public final class ResourceSyncRuleImpl - implements ResourceSyncRule, ResourceSyncRule.Definition, ResourceSyncRule.Update { - private ResourceSyncRuleInner innerObject; - - private final com.azure.resourcemanager.extendedlocation.CustomLocationsManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public Integer priority() { - return this.innerModel().priority(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public ResourceSyncRulePropertiesSelector selector() { - return this.innerModel().selector(); - } - - public String targetResourceGroup() { - return this.innerModel().targetResourceGroup(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ResourceSyncRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String childResourceName; - - private PatchableResourceSyncRule updateParameters; - - public ResourceSyncRuleImpl withExistingCustomLocation(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public ResourceSyncRule create() { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .createOrUpdate(resourceGroupName, resourceName, childResourceName, this.innerModel(), Context.NONE); - return this; - } - - public ResourceSyncRule create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .createOrUpdate(resourceGroupName, resourceName, childResourceName, this.innerModel(), context); - return this; - } - - ResourceSyncRuleImpl(String name, - com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager) { - this.innerObject = new ResourceSyncRuleInner(); - this.serviceManager = serviceManager; - this.childResourceName = name; - } - - public ResourceSyncRuleImpl update() { - this.updateParameters = new PatchableResourceSyncRule(); - return this; - } - - public ResourceSyncRule apply() { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .update(resourceGroupName, resourceName, childResourceName, updateParameters, Context.NONE); - return this; - } - - public ResourceSyncRule apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .update(resourceGroupName, resourceName, childResourceName, updateParameters, context); - return this; - } - - ResourceSyncRuleImpl(ResourceSyncRuleInner innerObject, - com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "customLocations"); - this.childResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceSyncRules"); - } - - public ResourceSyncRule refresh() { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE) - .getValue(); - return this; - } - - public ResourceSyncRule refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceSyncRules() - .getWithResponse(resourceGroupName, resourceName, childResourceName, context) - .getValue(); - return this; - } - - public ResourceSyncRuleImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ResourceSyncRuleImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ResourceSyncRuleImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } - } - - public ResourceSyncRuleImpl withPriority(Integer priority) { - if (isInCreateMode()) { - this.innerModel().withPriority(priority); - return this; - } else { - this.updateParameters.withPriority(priority); - return this; - } - } - - public ResourceSyncRuleImpl withSelector(ResourceSyncRulePropertiesSelector selector) { - if (isInCreateMode()) { - this.innerModel().withSelector(selector); - return this; - } else { - this.updateParameters.withSelector(selector); - return this; - } - } - - public ResourceSyncRuleImpl withTargetResourceGroup(String targetResourceGroup) { - if (isInCreateMode()) { - this.innerModel().withTargetResourceGroup(targetResourceGroup); - return this; - } else { - this.updateParameters.withTargetResourceGroup(targetResourceGroup); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesClientImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesClientImpl.java deleted file mode 100644 index 5dfad2ab07a1e..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesClientImpl.java +++ /dev/null @@ -1,1211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.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.extendedlocation.fluent.ResourceSyncRulesClient; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner; -import com.azure.resourcemanager.extendedlocation.models.PatchableResourceSyncRule; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRuleListResult; -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 ResourceSyncRulesClient. - */ -public final class ResourceSyncRulesClientImpl implements ResourceSyncRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceSyncRulesService service; - - /** - * The service client containing this operation class. - */ - private final CustomLocationsManagementClientImpl client; - - /** - * Initializes an instance of ResourceSyncRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceSyncRulesClientImpl(CustomLocationsManagementClientImpl client) { - this.service - = RestProxy.create(ResourceSyncRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CustomLocationsManagementClientResourceSyncRules to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "CustomLocationsManag") - public interface ResourceSyncRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomLocationId(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") ResourceSyncRuleInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("childResourceName") String childResourceName, - @BodyParam("application/json") PatchableResourceSyncRule parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomLocationIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomLocationIdSinglePageAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByCustomLocationId(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomLocationIdSinglePageAsync(String resourceGroupName, - String resourceName, 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomLocationId(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomLocationIdAsync(String resourceGroupName, - String resourceName) { - return new PagedFlux<>(() -> listByCustomLocationIdSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listByCustomLocationIdNextSinglePageAsync(nextLink)); - } - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomLocationIdAsync(String resourceGroupName, String resourceName, - Context context) { - return new PagedFlux<>(() -> listByCustomLocationIdSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listByCustomLocationIdNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listByCustomLocationIdAsync(resourceGroupName, resourceName)); - } - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(listByCustomLocationIdAsync(resourceGroupName, resourceName, context)); - } - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, - String childResourceName) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceSyncRuleInner get(String resourceGroupName, String resourceName, String childResourceName) { - return getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, ResourceSyncRuleInner 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String childResourceName, ResourceSyncRuleInner 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ResourceSyncRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ResourceSyncRuleInner.class, ResourceSyncRuleInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ResourceSyncRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ResourceSyncRuleInner.class, ResourceSyncRuleInner.class, context); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ResourceSyncRuleInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ResourceSyncRuleInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters, - Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, ResourceSyncRuleInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String childResourceName, ResourceSyncRuleInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceSyncRuleInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - ResourceSyncRuleInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters).block(); - } - - /** - * Creates or updates a Resource Sync Rule. - * - * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters Parameters supplied to create or update a Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceSyncRuleInner createOrUpdate(String resourceGroupName, String resourceName, String childResourceName, - ResourceSyncRuleInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, accept, context); - } - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String childResourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, childResourceName, context).block(); - } - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, PatchableResourceSyncRule 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, childResourceName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - String childResourceName, PatchableResourceSyncRule 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (childResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter childResourceName 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.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, childResourceName, parameters, accept, context); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ResourceSyncRuleInner> beginUpdateAsync( - String resourceGroupName, String resourceName, String childResourceName, PatchableResourceSyncRule parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ResourceSyncRuleInner.class, ResourceSyncRuleInner.class, - this.client.getContext()); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ResourceSyncRuleInner> beginUpdateAsync( - String resourceGroupName, String resourceName, String childResourceName, PatchableResourceSyncRule parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, childResourceName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ResourceSyncRuleInner.class, ResourceSyncRuleInner.class, context); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ResourceSyncRuleInner> beginUpdate(String resourceGroupName, - String resourceName, String childResourceName, PatchableResourceSyncRule parameters) { - return this.beginUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters).getSyncPoller(); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ResourceSyncRuleInner> beginUpdate(String resourceGroupName, - String resourceName, String childResourceName, PatchableResourceSyncRule parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - String childResourceName, PatchableResourceSyncRule parameters) { - return beginUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - String childResourceName, PatchableResourceSyncRule parameters, Context context) { - return beginUpdateAsync(resourceGroupName, resourceName, childResourceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceSyncRuleInner update(String resourceGroupName, String resourceName, String childResourceName, - PatchableResourceSyncRule parameters) { - return updateAsync(resourceGroupName, resourceName, childResourceName, parameters).block(); - } - - /** - * Updates a Resource Sync Rule. - * - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, - * Subscription and Custom Location name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param parameters The updatable fields of an existing Resource Sync Rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource Sync Rules definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceSyncRuleInner update(String resourceGroupName, String resourceName, String childResourceName, - PatchableResourceSyncRule parameters, Context context) { - return updateAsync(resourceGroupName, resourceName, childResourceName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Resource Sync Rules operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomLocationIdNextSinglePageAsync(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.listByCustomLocationIdNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Resource Sync Rules operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomLocationIdNextSinglePageAsync(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.listByCustomLocationIdNext(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/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesImpl.java deleted file mode 100644 index a041fad6c63ec..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/ResourceSyncRulesImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.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.extendedlocation.fluent.ResourceSyncRulesClient; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRule; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRules; - -public final class ResourceSyncRulesImpl implements ResourceSyncRules { - private static final ClientLogger LOGGER = new ClientLogger(ResourceSyncRulesImpl.class); - - private final ResourceSyncRulesClient innerClient; - - private final com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager; - - public ResourceSyncRulesImpl(ResourceSyncRulesClient innerClient, - com.azure.resourcemanager.extendedlocation.CustomLocationsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName) { - PagedIterable inner - = this.serviceClient().listByCustomLocationId(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSyncRuleImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().listByCustomLocationId(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSyncRuleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String resourceName, - String childResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, childResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ResourceSyncRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ResourceSyncRule get(String resourceGroupName, String resourceName, String childResourceName) { - ResourceSyncRuleInner inner = this.serviceClient().get(resourceGroupName, resourceName, childResourceName); - if (inner != null) { - return new ResourceSyncRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void delete(String resourceGroupName, String resourceName, String childResourceName) { - this.serviceClient().delete(resourceGroupName, resourceName, childResourceName); - } - - public ResourceSyncRule getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "customLocations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customLocations'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "resourceSyncRules"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceSyncRules'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "customLocations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customLocations'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "resourceSyncRules"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceSyncRules'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "customLocations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customLocations'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "resourceSyncRules"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceSyncRules'.", id))); - } - this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "customLocations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customLocations'.", id))); - } - String childResourceName = ResourceManagerUtils.getValueFromIdByName(id, "resourceSyncRules"); - if (childResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceSyncRules'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, childResourceName, context); - } - - private ResourceSyncRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager() { - return this.serviceManager; - } - - public ResourceSyncRuleImpl define(String name) { - return new ResourceSyncRuleImpl(name, this.manager()); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java index f55a14ae741a5..74836589a6e98 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.extendedlocation.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; @@ -515,35 +514,4 @@ interface WithProvisioningState { * @return the refreshed resource. */ CustomLocation refresh(Context context); - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param parameters Parameters of the find target resource group request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response}. - */ - Response findTargetResourceGroupWithResponse( - CustomLocationFindTargetResourceGroupProperties parameters, Context context); - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response. - */ - CustomLocationFindTargetResourceGroupResult - findTargetResourceGroup(CustomLocationFindTargetResourceGroupProperties parameters); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupProperties.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupProperties.java deleted file mode 100644 index f567e0fb1dd60..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupProperties.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The Find Target Resource Group operation request. - */ -@Fluent -public final class CustomLocationFindTargetResourceGroupProperties - implements JsonSerializable { - /* - * Labels of the custom resource, this is a map of {key,value} pairs. - */ - private Map labels; - - /** - * Creates an instance of CustomLocationFindTargetResourceGroupProperties class. - */ - public CustomLocationFindTargetResourceGroupProperties() { - } - - /** - * Get the labels property: Labels of the custom resource, this is a map of {key,value} pairs. - * - * @return the labels value. - */ - public Map labels() { - return this.labels; - } - - /** - * Set the labels property: Labels of the custom resource, this is a map of {key,value} pairs. - * - * @param labels the labels value to set. - * @return the CustomLocationFindTargetResourceGroupProperties object itself. - */ - public CustomLocationFindTargetResourceGroupProperties withLabels(Map labels) { - this.labels = labels; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomLocationFindTargetResourceGroupProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomLocationFindTargetResourceGroupProperties if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CustomLocationFindTargetResourceGroupProperties. - */ - public static CustomLocationFindTargetResourceGroupProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomLocationFindTargetResourceGroupProperties deserializedCustomLocationFindTargetResourceGroupProperties - = new CustomLocationFindTargetResourceGroupProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("labels".equals(fieldName)) { - Map labels = reader.readMap(reader1 -> reader1.getString()); - deserializedCustomLocationFindTargetResourceGroupProperties.labels = labels; - } else { - reader.skipChildren(); - } - } - - return deserializedCustomLocationFindTargetResourceGroupProperties; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupResult.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupResult.java deleted file mode 100644 index 224adcf3b3071..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationFindTargetResourceGroupResult.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.extendedlocation.models; - -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; - -/** - * An immutable client-side representation of CustomLocationFindTargetResourceGroupResult. - */ -public interface CustomLocationFindTargetResourceGroupResult { - /** - * Gets the matchedResourceSyncRule property: The matching resource sync rule is the particular resource sync rule - * that matched the match expressions and labels and had lowest priority. This is the rule responsible for mapping - * the target resource to the target resource group. - * - * @return the matchedResourceSyncRule value. - */ - String matchedResourceSyncRule(); - - /** - * Gets the targetResourceGroup property: The target resource group of matching resource sync rule. The labels from - * the request will be used to find out matching resource sync rule against the selector property of the resource - * sync rule. The one with highest priority will be returned if there are multiple matching rules. - * - * @return the targetResourceGroup value. - */ - String targetResourceGroup(); - - /** - * Gets the inner - * com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner object. - * - * @return the inner object. - */ - CustomLocationFindTargetResourceGroupResultInner innerModel(); -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java index 8bc239f5a06e0..72cd13504cd2a 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java @@ -178,41 +178,6 @@ Response getByResourceGroupWithResponse(String resourceGroupName PagedIterable listEnabledResourceTypes(String resourceGroupName, String resourceName, Context context); - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response along with {@link Response}. - */ - Response findTargetResourceGroupWithResponse(String resourceGroupName, - String resourceName, CustomLocationFindTargetResourceGroupProperties parameters, Context context); - - /** - * Gets matching target resource group for resource sync. - * - * Returns the target resource group associated with the resource sync rules of the Custom Location that match the - * rules passed in with the Find Target Resource Group Request. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param parameters Parameters of the find target resource group request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Find Target Resource Group operation response. - */ - CustomLocationFindTargetResourceGroupResult findTargetResourceGroup(String resourceGroupName, String resourceName, - CustomLocationFindTargetResourceGroupProperties parameters); - /** * Gets a Custom Location. * diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/MatchExpressionsProperties.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/MatchExpressionsProperties.java deleted file mode 100644 index 8237e38783e05..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/MatchExpressionsProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Resource Sync Rules matchExpression property definition. - */ -@Fluent -public final class MatchExpressionsProperties implements JsonSerializable { - /* - * Key is the label key that the selector applies to. - */ - private String key; - - /* - * The Operator field represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and - * DoesNotExist. - */ - private String operator; - - /* - * The label value - */ - private List values; - - /** - * Creates an instance of MatchExpressionsProperties class. - */ - public MatchExpressionsProperties() { - } - - /** - * Get the key property: Key is the label key that the selector applies to. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: Key is the label key that the selector applies to. - * - * @param key the key value to set. - * @return the MatchExpressionsProperties object itself. - */ - public MatchExpressionsProperties withKey(String key) { - this.key = key; - return this; - } - - /** - * Get the operator property: The Operator field represents a key's relationship to a set of values. Valid operators - * are In, NotIn, Exists and DoesNotExist. - * - * @return the operator value. - */ - public String operator() { - return this.operator; - } - - /** - * Set the operator property: The Operator field represents a key's relationship to a set of values. Valid operators - * are In, NotIn, Exists and DoesNotExist. - * - * @param operator the operator value to set. - * @return the MatchExpressionsProperties object itself. - */ - public MatchExpressionsProperties withOperator(String operator) { - this.operator = operator; - return this; - } - - /** - * Get the values property: The label value. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The label value. - * - * @param values the values value to set. - * @return the MatchExpressionsProperties object itself. - */ - public MatchExpressionsProperties withValues(List values) { - this.values = values; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); - jsonWriter.writeStringField("operator", this.operator); - jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MatchExpressionsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MatchExpressionsProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MatchExpressionsProperties. - */ - public static MatchExpressionsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MatchExpressionsProperties deserializedMatchExpressionsProperties = new MatchExpressionsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedMatchExpressionsProperties.key = reader.getString(); - } else if ("operator".equals(fieldName)) { - deserializedMatchExpressionsProperties.operator = reader.getString(); - } else if ("values".equals(fieldName)) { - List values = reader.readArray(reader1 -> reader1.getString()); - deserializedMatchExpressionsProperties.values = values; - } else { - reader.skipChildren(); - } - } - - return deserializedMatchExpressionsProperties; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableResourceSyncRule.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableResourceSyncRule.java deleted file mode 100644 index 53abfbad6b25c..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableResourceSyncRule.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleProperties; -import java.io.IOException; -import java.util.Map; - -/** - * The Resource Sync Rules patchable resource definition. - */ -@Fluent -public final class PatchableResourceSyncRule implements JsonSerializable { - /* - * The Resource Sync Rules patchable properties. - */ - private ResourceSyncRuleProperties innerProperties; - - /* - * Resource tags - */ - private Map tags; - - /** - * Creates an instance of PatchableResourceSyncRule class. - */ - public PatchableResourceSyncRule() { - } - - /** - * Get the innerProperties property: The Resource Sync Rules patchable properties. - * - * @return the innerProperties value. - */ - private ResourceSyncRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the PatchableResourceSyncRule object itself. - */ - public PatchableResourceSyncRule withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @return the priority value. - */ - public Integer priority() { - return this.innerProperties() == null ? null : this.innerProperties().priority(); - } - - /** - * Set the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @param priority the priority value to set. - * @return the PatchableResourceSyncRule object itself. - */ - public PatchableResourceSyncRule withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withPriority(priority); - return this; - } - - /** - * Get the provisioningState property: Provisioning State for the Resource Sync Rule. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @return the selector value. - */ - public ResourceSyncRulePropertiesSelector selector() { - return this.innerProperties() == null ? null : this.innerProperties().selector(); - } - - /** - * Set the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include - * In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set - * must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and - * matchExpressions must all be satisfied in order to match. - * - * @param selector the selector value to set. - * @return the PatchableResourceSyncRule object itself. - */ - public PatchableResourceSyncRule withSelector(ResourceSyncRulePropertiesSelector selector) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withSelector(selector); - return this; - } - - /** - * Get the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @return the targetResourceGroup value. - */ - public String targetResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().targetResourceGroup(); - } - - /** - * Set the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @param targetResourceGroup the targetResourceGroup value to set. - * @return the PatchableResourceSyncRule object itself. - */ - public PatchableResourceSyncRule withTargetResourceGroup(String targetResourceGroup) { - if (this.innerProperties() == null) { - this.innerProperties = new ResourceSyncRuleProperties(); - } - this.innerProperties().withTargetResourceGroup(targetResourceGroup); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchableResourceSyncRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchableResourceSyncRule if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PatchableResourceSyncRule. - */ - public static PatchableResourceSyncRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchableResourceSyncRule deserializedPatchableResourceSyncRule = new PatchableResourceSyncRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedPatchableResourceSyncRule.innerProperties = ResourceSyncRuleProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPatchableResourceSyncRule.tags = tags; - } else { - reader.skipChildren(); - } - } - - return deserializedPatchableResourceSyncRule; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRule.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRule.java deleted file mode 100644 index 56b10e3004f25..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRule.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner; -import java.util.Map; - -/** - * An immutable client-side representation of ResourceSyncRule. - */ -public interface ResourceSyncRule { - /** - * 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 systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @return the priority value. - */ - Integer priority(); - - /** - * Gets the provisioningState property: Provisioning State for the Resource Sync Rule. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The - * first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent - * to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains - * only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators - * include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The - * values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels - * and matchExpressions must all be satisfied in order to match. - * - * @return the selector value. - */ - ResourceSyncRulePropertiesSelector selector(); - - /** - * Gets the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the - * unmapped custom resource will be projected to the target resource group associated with this resource sync rule. - * The user creating this resource sync rule should have write permissions on the target resource group and this - * write permission will be validated when creating the resource sync rule. - * - * @return the targetResourceGroup value. - */ - String targetResourceGroup(); - - /** - * 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.extendedlocation.fluent.models.ResourceSyncRuleInner object. - * - * @return the inner object. - */ - ResourceSyncRuleInner innerModel(); - - /** - * The entirety of the ResourceSyncRule definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ResourceSyncRule definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ResourceSyncRule definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the ResourceSyncRule 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 ResourceSyncRule definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @return the next definition stage. - */ - WithCreate withExistingCustomLocation(String resourceGroupName, String resourceName); - } - - /** - * The stage of the ResourceSyncRule 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.WithPriority, - DefinitionStages.WithSelector, DefinitionStages.WithTargetResourceGroup { - /** - * Executes the create request. - * - * @return the created resource. - */ - ResourceSyncRule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ResourceSyncRule create(Context context); - } - - /** - * The stage of the ResourceSyncRule 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 ResourceSyncRule definition allowing to specify priority. - */ - interface WithPriority { - /** - * Specifies the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @param priority Priority represents a priority of the Resource Sync Rule. - * @return the next definition stage. - */ - WithCreate withPriority(Integer priority); - } - - /** - * The stage of the ResourceSyncRule definition allowing to specify selector. - */ - interface WithSelector { - /** - * Specifies the selector property: A label selector is composed of two parts, matchLabels and - * matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the - * matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator - * is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of - * resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values - * set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and - * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied - * in order to match.. - * - * @param selector A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is - * equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the - * values array contains only 'value'. The second part, matchExpressions is a list of resource selector - * requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be - * non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and - * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied - * in order to match. - * @return the next definition stage. - */ - WithCreate withSelector(ResourceSyncRulePropertiesSelector selector); - } - - /** - * The stage of the ResourceSyncRule definition allowing to specify targetResourceGroup. - */ - interface WithTargetResourceGroup { - /** - * Specifies the targetResourceGroup property: For an unmapped custom resource, its labels will be used to - * find matching resource sync rules. If this resource sync rule is one of the matching rules with highest - * priority, then the unmapped custom resource will be projected to the target resource group associated - * with this resource sync rule. The user creating this resource sync rule should have write permissions on - * the target resource group and this write permission will be validated when creating the resource sync - * rule.. - * - * @param targetResourceGroup For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then - * the unmapped custom resource will be projected to the target resource group associated with this resource - * sync rule. The user creating this resource sync rule should have write permissions on the target resource - * group and this write permission will be validated when creating the resource sync rule. - * @return the next definition stage. - */ - WithCreate withTargetResourceGroup(String targetResourceGroup); - } - } - - /** - * Begins update for the ResourceSyncRule resource. - * - * @return the stage of resource update. - */ - ResourceSyncRule.Update update(); - - /** - * The template for ResourceSyncRule update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithPriority, UpdateStages.WithSelector, - UpdateStages.WithTargetResourceGroup { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ResourceSyncRule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ResourceSyncRule apply(Context context); - } - - /** - * The ResourceSyncRule update stages. - */ - interface UpdateStages { - /** - * The stage of the ResourceSyncRule update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ResourceSyncRule update allowing to specify priority. - */ - interface WithPriority { - /** - * Specifies the priority property: Priority represents a priority of the Resource Sync Rule. - * - * @param priority Priority represents a priority of the Resource Sync Rule. - * @return the next definition stage. - */ - Update withPriority(Integer priority); - } - - /** - * The stage of the ResourceSyncRule update allowing to specify selector. - */ - interface WithSelector { - /** - * Specifies the selector property: A label selector is composed of two parts, matchLabels and - * matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the - * matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator - * is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of - * resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values - * set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and - * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied - * in order to match.. - * - * @param selector A label selector is composed of two parts, matchLabels and matchExpressions. The first - * part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is - * equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the - * values array contains only 'value'. The second part, matchExpressions is a list of resource selector - * requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be - * non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and - * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied - * in order to match. - * @return the next definition stage. - */ - Update withSelector(ResourceSyncRulePropertiesSelector selector); - } - - /** - * The stage of the ResourceSyncRule update allowing to specify targetResourceGroup. - */ - interface WithTargetResourceGroup { - /** - * Specifies the targetResourceGroup property: For an unmapped custom resource, its labels will be used to - * find matching resource sync rules. If this resource sync rule is one of the matching rules with highest - * priority, then the unmapped custom resource will be projected to the target resource group associated - * with this resource sync rule. The user creating this resource sync rule should have write permissions on - * the target resource group and this write permission will be validated when creating the resource sync - * rule.. - * - * @param targetResourceGroup For an unmapped custom resource, its labels will be used to find matching - * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then - * the unmapped custom resource will be projected to the target resource group associated with this resource - * sync rule. The user creating this resource sync rule should have write permissions on the target resource - * group and this write permission will be validated when creating the resource sync rule. - * @return the next definition stage. - */ - Update withTargetResourceGroup(String targetResourceGroup); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ResourceSyncRule refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ResourceSyncRule refresh(Context context); -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRuleListResult.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRuleListResult.java deleted file mode 100644 index 1d8ab40fea6f4..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRuleListResult.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner; -import java.io.IOException; -import java.util.List; - -/** - * The List Resource Sync Rules operation response. - */ -@Immutable -public final class ResourceSyncRuleListResult implements JsonSerializable { - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /* - * The list of Resource Sync Rules. - */ - private List value; - - /** - * Creates an instance of ResourceSyncRuleListResult class. - */ - public ResourceSyncRuleListResult() { - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of Resource Sync Rules. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSyncRuleListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSyncRuleListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceSyncRuleListResult. - */ - public static ResourceSyncRuleListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSyncRuleListResult deserializedResourceSyncRuleListResult = new ResourceSyncRuleListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedResourceSyncRuleListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ResourceSyncRuleInner.fromJson(reader1)); - deserializedResourceSyncRuleListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSyncRuleListResult; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRulePropertiesSelector.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRulePropertiesSelector.java deleted file mode 100644 index 3e82f2c7cb632..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRulePropertiesSelector.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of - * {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose - * key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, - * matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and - * DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case - * of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied - * in order to match. - */ -@Fluent -public final class ResourceSyncRulePropertiesSelector implements JsonSerializable { - /* - * MatchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and - * DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the - * case of Exists and DoesNotExist. - */ - private List matchExpressions; - - /* - * MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an - * element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only - * 'value'. - */ - private Map matchLabels; - - /** - * Creates an instance of ResourceSyncRulePropertiesSelector class. - */ - public ResourceSyncRulePropertiesSelector() { - } - - /** - * Get the matchExpressions property: MatchExpressions is a list of resource selector requirements. Valid operators - * include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The - * values set must be empty in the case of Exists and DoesNotExist. - * - * @return the matchExpressions value. - */ - public List matchExpressions() { - return this.matchExpressions; - } - - /** - * Set the matchExpressions property: MatchExpressions is a list of resource selector requirements. Valid operators - * include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The - * values set must be empty in the case of Exists and DoesNotExist. - * - * @param matchExpressions the matchExpressions value to set. - * @return the ResourceSyncRulePropertiesSelector object itself. - */ - public ResourceSyncRulePropertiesSelector withMatchExpressions(List matchExpressions) { - this.matchExpressions = matchExpressions; - return this; - } - - /** - * Get the matchLabels property: MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - * map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the - * values array contains only 'value'. - * - * @return the matchLabels value. - */ - public Map matchLabels() { - return this.matchLabels; - } - - /** - * Set the matchLabels property: MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - * map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the - * values array contains only 'value'. - * - * @param matchLabels the matchLabels value to set. - * @return the ResourceSyncRulePropertiesSelector object itself. - */ - public ResourceSyncRulePropertiesSelector withMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (matchExpressions() != null) { - matchExpressions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("matchExpressions", this.matchExpressions, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("matchLabels", this.matchLabels, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSyncRulePropertiesSelector from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSyncRulePropertiesSelector if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceSyncRulePropertiesSelector. - */ - public static ResourceSyncRulePropertiesSelector fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSyncRulePropertiesSelector deserializedResourceSyncRulePropertiesSelector - = new ResourceSyncRulePropertiesSelector(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("matchExpressions".equals(fieldName)) { - List matchExpressions - = reader.readArray(reader1 -> MatchExpressionsProperties.fromJson(reader1)); - deserializedResourceSyncRulePropertiesSelector.matchExpressions = matchExpressions; - } else if ("matchLabels".equals(fieldName)) { - Map matchLabels = reader.readMap(reader1 -> reader1.getString()); - deserializedResourceSyncRulePropertiesSelector.matchLabels = matchLabels; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSyncRulePropertiesSelector; - }); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRules.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRules.java deleted file mode 100644 index ce05dc737b331..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceSyncRules.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.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 ResourceSyncRules. - */ -public interface ResourceSyncRules { - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName); - - /** - * Lists all Resource Sync Rules in a Custom Location. - * - * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each - * Resource Sync Rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Resource Sync Rules in the specified subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCustomLocationId(String resourceGroupName, String resourceName, - Context context); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - */ - ResourceSyncRule get(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String childResourceName, - Context context); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String resourceName, String childResourceName); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @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 details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response}. - */ - ResourceSyncRule getById(String id); - - /** - * Gets a Resource Sync Rule. - * - * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name. - * - * @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 details of the resourceSyncRule with a specified resource group, subscription id Custom Location - * resource name and Resource Sync Rule name along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a Resource Sync Rule. - * - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, - * Resource Group, and Subscription Id. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ResourceSyncRule resource. - * - * @param name resource name. - * @return the first stage of the new ResourceSyncRule definition. - */ - ResourceSyncRule.DefinitionStages.Blank define(String name); -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-extendedlocation/proxy-config.json b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-extendedlocation/proxy-config.json index 9be2b1efd2e7c..218cc932946dd 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-extendedlocation/proxy-config.json +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-extendedlocation/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.extendedlocation.implementation.CustomLocationsClientImpl$CustomLocationsService"],["com.azure.resourcemanager.extendedlocation.implementation.ResourceSyncRulesClientImpl$ResourceSyncRulesService"]] \ No newline at end of file +[["com.azure.resourcemanager.extendedlocation.implementation.CustomLocationsClientImpl$CustomLocationsService"]] \ No newline at end of file diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateSamples.java index c6209d75ddf31..152d5a98f8375 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class CustomLocationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsCreate_Update.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsDeleteSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsDeleteSamples.java index 5343481aba4c6..a47e929a6d37d 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsDeleteSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsDeleteSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsDeleteSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsDelete.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupSamples.java deleted file mode 100644 index 13863ed8a6ecd..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupSamples.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.generated; - -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CustomLocations FindTargetResourceGroup. - */ -public final class CustomLocationsFindTargetResourceGroupSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * CustomLocationsFindTargetResourceGroup.json - */ - /** - * Sample code: Post Custom Location Find Target Resource Group. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void postCustomLocationFindTargetResourceGroup( - com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.customLocations() - .findTargetResourceGroupWithResponse("testresourcegroup", "customLocation01", - new CustomLocationFindTargetResourceGroupProperties() - .withLabels(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")), - com.azure.core.util.Context.NONE); - } - - // 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/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupSamples.java index be092e0fa8dbe..930259877d143 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsGet.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupSamples.java index 59d5aa625cc54..c78caee5b94f1 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListByResourceGroup.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesSamples.java index cfbaefa46311e..8bc549dae1181 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsListEnabledResourceTypesSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListEnabledResourceTypes.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsSamples.java index 33350cd9eea46..6ed819df361c9 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsListOperationsSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListOperations.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListSamples.java index 038edee4c5878..faa304f76fbab 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListSamples.java @@ -10,7 +10,7 @@ public final class CustomLocationsListSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsListBySubscription.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsUpdateSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsUpdateSamples.java index 4e4ba3d65baa9..d14dad054de7c 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsUpdateSamples.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsUpdateSamples.java @@ -17,7 +17,7 @@ public final class CustomLocationsUpdateSamples { /* * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ + * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/examples/ * CustomLocationsPatch.json */ /** diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesCreateOrUpdateSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesCreateOrUpdateSamples.java deleted file mode 100644 index 104429654b657..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesCreateOrUpdateSamples.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.extendedlocation.generated; - -import com.azure.resourcemanager.extendedlocation.models.MatchExpressionsProperties; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRulePropertiesSelector; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for ResourceSyncRules CreateOrUpdate. - */ -public final class ResourceSyncRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesCreate_Update.json - */ - /** - * Sample code: Create/Update Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - createUpdateResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .define("resourceSyncRule01") - .withRegion("West US") - .withExistingCustomLocation("testresourcegroup", "customLocation01") - .withPriority(999) - .withSelector(new ResourceSyncRulePropertiesSelector() - .withMatchExpressions(Arrays.asList(new MatchExpressionsProperties().withKey("fakeTokenPlaceholder") - .withOperator("In") - .withValues(Arrays.asList("value4")))) - .withMatchLabels(mapOf("key1", "fakeTokenPlaceholder"))) - .withTargetResourceGroup( - "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup") - .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/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteSamples.java deleted file mode 100644 index 014c4a467dad1..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.extendedlocation.generated; - -/** - * Samples for ResourceSyncRules Delete. - */ -public final class ResourceSyncRulesDeleteSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesDelete.json - */ - /** - * Sample code: Delete Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - deleteResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .deleteWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesGetSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesGetSamples.java deleted file mode 100644 index 994a31e858e11..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesGetSamples.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.extendedlocation.generated; - -/** - * Samples for ResourceSyncRules Get. - */ -public final class ResourceSyncRulesGetSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesGet.json - */ - /** - * Sample code: Get Custom Location. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void getCustomLocation(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .getWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesListByCustomLocationIdSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesListByCustomLocationIdSamples.java deleted file mode 100644 index f64d64d60665c..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesListByCustomLocationIdSamples.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.extendedlocation.generated; - -/** - * Samples for ResourceSyncRules ListByCustomLocationId. - */ -public final class ResourceSyncRulesListByCustomLocationIdSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesListByCustomLocationID.json - */ - /** - * Sample code: List Resource Sync Rules by subscription. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - listResourceSyncRulesBySubscription(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - manager.resourceSyncRules() - .listByCustomLocationId("testresourcegroup", "customLocation01", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesUpdateSamples.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesUpdateSamples.java deleted file mode 100644 index d90fcb7297eb6..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/samples/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesUpdateSamples.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.extendedlocation.generated; - -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRule; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for ResourceSyncRules Update. - */ -public final class ResourceSyncRulesUpdateSamples { - /* - * x-ms-original-file: - * specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ - * ResourceSyncRulesPatch.json - */ - /** - * Sample code: Update Resource Sync Rule. - * - * @param manager Entry point to CustomLocationsManager. - */ - public static void - updateResourceSyncRule(com.azure.resourcemanager.extendedlocation.CustomLocationsManager manager) { - ResourceSyncRule resource = manager.resourceSyncRules() - .getWithResponse("testresourcegroup", "customLocation01", "resourceSyncRule01", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tier", "testing")) - .withTargetResourceGroup("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testrg/") - .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/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupPropertiesTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupPropertiesTests.java deleted file mode 100644 index bb27c075ce9c5..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupPropertiesTests.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.extendedlocation.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CustomLocationFindTargetResourceGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomLocationFindTargetResourceGroupProperties model = BinaryData.fromString( - "{\"labels\":{\"xkrxdqmi\":\"gug\",\"abhjybi\":\"tthzrvqd\",\"ktzlcuiywg\":\"ehoqfbowskan\",\"nhzgpphrcgyn\":\"ywgndrv\"}}") - .toObject(CustomLocationFindTargetResourceGroupProperties.class); - Assertions.assertEquals("gug", model.labels().get("xkrxdqmi")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomLocationFindTargetResourceGroupProperties model - = new CustomLocationFindTargetResourceGroupProperties().withLabels(mapOf("xkrxdqmi", "gug", "abhjybi", - "tthzrvqd", "ktzlcuiywg", "ehoqfbowskan", "nhzgpphrcgyn", "ywgndrv")); - model = BinaryData.fromObject(model).toObject(CustomLocationFindTargetResourceGroupProperties.class); - Assertions.assertEquals("gug", model.labels().get("xkrxdqmi")); - } - - // 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/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupResultInnerTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupResultInnerTests.java deleted file mode 100644 index 3daa3fe7ec354..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationFindTargetResourceGroupResultInnerTests.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.extendedlocation.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationFindTargetResourceGroupResultInner; - -public final class CustomLocationFindTargetResourceGroupResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomLocationFindTargetResourceGroupResultInner model - = BinaryData.fromString("{\"matchedResourceSyncRule\":\"cpecfvmmcoofs\",\"targetResourceGroup\":\"zevgb\"}") - .toObject(CustomLocationFindTargetResourceGroupResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomLocationFindTargetResourceGroupResultInner model = new CustomLocationFindTargetResourceGroupResultInner(); - model = BinaryData.fromObject(model).toObject(CustomLocationFindTargetResourceGroupResultInner.class); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateMockTests.java index 957e717ab54b5..5c87ffec12ba0 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsCreateOrUpdateMockTests.java @@ -28,7 +28,7 @@ public final class CustomLocationsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"identity\":{\"principalId\":\"njbkcnxdhbttkph\",\"tenantId\":\"pnvjtoqnermclf\",\"type\":\"SystemAssigned\"},\"properties\":{\"authentication\":{\"type\":\"uscrpabgyepsb\",\"value\":\"azqugxywpmueefj\"},\"clusterExtensionIds\":[\"qkqujidsu\",\"onobglaocqx\"],\"displayName\":\"cmgyud\",\"hostResourceId\":\"tlmoyrx\",\"hostType\":\"Kubernetes\",\"namespace\":\"dw\",\"provisioningState\":\"Succeeded\"},\"location\":\"lhrxsbkyvpyc\",\"tags\":{\"p\":\"z\",\"hhseyv\":\"kafkuwbcrnwbm\",\"tslhspkdeem\":\"us\"},\"id\":\"ofmxagkvtmelmqkr\",\"name\":\"ahvljuaha\",\"type\":\"uhcdhm\"}"; + = "{\"identity\":{\"principalId\":\"ivfsnk\",\"tenantId\":\"uctqhjfbe\",\"type\":\"None\"},\"properties\":{\"authentication\":{\"type\":\"rfuwutt\",\"value\":\"fvjrbirphxepcy\"},\"clusterExtensionIds\":[\"fnljky\",\"xjvuujqgidokg\"],\"displayName\":\"jyoxgvclt\",\"hostResourceId\":\"sncghkjeszz\",\"hostType\":\"Kubernetes\",\"namespace\":\"htxfvgxbfsmxnehm\",\"provisioningState\":\"Succeeded\"},\"location\":\"odebfqkkrbmpu\",\"tags\":{\"lzlfbxzpuz\":\"iw\",\"yydhibnuqqk\":\"cispnqzahmgkbr\",\"drgvtqagn\":\"ik\"},\"id\":\"uynhijg\",\"name\":\"mebf\",\"type\":\"iarbutrcvpna\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -38,30 +38,32 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); CustomLocation response = manager.customLocations() - .define("zjancuxr") - .withRegion("nyqupedeojnabck") - .withExistingResourceGroup("qwalmuzyoxaepd") - .withTags(mapOf("ie", "txp", "jdhtldwkyzxu", "tfhvpesapskrdqmh", "svlxotogtwrup", "tkncwsc")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withAuthentication(new CustomLocationPropertiesAuthentication().withType("pzxbz").withValue("zabglcuhxwt")) - .withClusterExtensionIds(Arrays.asList("qik", "bbovplwzbhvgyugu", "svmkfssxquk", "fpl")) - .withDisplayName("gsxnkjzkdeslpv") - .withHostResourceId("pwiyig") + .define("wburvjxxjnspydpt") + .withRegion("ixzbinjeputtmryw") + .withExistingResourceGroup("gigr") + .withTags(mapOf("yx", "oqftiyqzrnkcq", "nwvlryavwhheunmm", "whzlsicohoq", "koklya", "hgyxzkonoc", + "ewrmjmwvvjektc", "uconuqszfkbey")) + .withIdentity(new Identity().withType(ResourceIdentityType.NONE)) + .withAuthentication( + new CustomLocationPropertiesAuthentication().withType("yxoegukgjnp").withValue("cgygev")) + .withClusterExtensionIds(Arrays.asList("typmrbpizcdrqjsd", "ydnfyhxdeoejz", "cwif", "jttgzf")) + .withDisplayName("shcbkhajdeyeamdp") + .withHostResourceId("g") .withHostType(HostType.KUBERNETES) - .withNamespace("dwzbaiue") - .withProvisioningState("a") + .withNamespace("uxwgipwho") + .withProvisioningState("wkgshwa") .create(); - Assertions.assertEquals("lhrxsbkyvpyc", response.location()); - Assertions.assertEquals("z", response.tags().get("p")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("uscrpabgyepsb", response.authentication().type()); - Assertions.assertEquals("azqugxywpmueefj", response.authentication().value()); - Assertions.assertEquals("qkqujidsu", response.clusterExtensionIds().get(0)); - Assertions.assertEquals("cmgyud", response.displayName()); - Assertions.assertEquals("tlmoyrx", response.hostResourceId()); + Assertions.assertEquals("odebfqkkrbmpu", response.location()); + Assertions.assertEquals("iw", response.tags().get("lzlfbxzpuz")); + Assertions.assertEquals(ResourceIdentityType.NONE, response.identity().type()); + Assertions.assertEquals("rfuwutt", response.authentication().type()); + Assertions.assertEquals("fvjrbirphxepcy", response.authentication().value()); + Assertions.assertEquals("fnljky", response.clusterExtensionIds().get(0)); + Assertions.assertEquals("jyoxgvclt", response.displayName()); + Assertions.assertEquals("sncghkjeszz", response.hostResourceId()); Assertions.assertEquals(HostType.KUBERNETES, response.hostType()); - Assertions.assertEquals("dw", response.namespace()); + Assertions.assertEquals("htxfvgxbfsmxnehm", response.namespace()); Assertions.assertEquals("Succeeded", response.provisioningState()); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupWithResponseMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6ea974811f224..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsFindTargetResourceGroupWithResponseMockTests.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.extendedlocation.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.extendedlocation.CustomLocationsManager; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupProperties; -import com.azure.resourcemanager.extendedlocation.models.CustomLocationFindTargetResourceGroupResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CustomLocationsFindTargetResourceGroupWithResponseMockTests { - @Test - public void testFindTargetResourceGroupWithResponse() throws Exception { - String responseStr = "{\"matchedResourceSyncRule\":\"dckzywbiexz\",\"targetResourceGroup\":\"yueaxibxujwb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CustomLocationsManager manager = CustomLocationsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomLocationFindTargetResourceGroupResult response = manager.customLocations() - .findTargetResourceGroupWithResponse("qidybyx", "zfcl", - new CustomLocationFindTargetResourceGroupProperties().withLabels( - mapOf("lfktsths", "xdbabphlwr", "twwrqp", "cocmnyyaztt")), - com.azure.core.util.Context.NONE) - .getValue(); - - } - - // 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/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupWithResponseMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupWithResponseMockTests.java index cc0bf4417e426..646b11ee20814 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsGetByResourceGroupWithResponseMockTests.java @@ -23,7 +23,7 @@ public final class CustomLocationsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"identity\":{\"principalId\":\"fkbey\",\"tenantId\":\"wrmjmwvvjektc\",\"type\":\"SystemAssigned\"},\"properties\":{\"authentication\":{\"type\":\"lrsf\",\"value\":\"zpwv\"},\"clusterExtensionIds\":[\"q\",\"biqylihkaet\",\"kt\",\"fcivfsnkym\"],\"displayName\":\"tqhjfbebrjcx\",\"hostResourceId\":\"fuwutttxf\",\"hostType\":\"Kubernetes\",\"namespace\":\"i\",\"provisioningState\":\"hxepcyvahfnlj\"},\"location\":\"qxj\",\"tags\":{\"gidokgjljyoxgvcl\":\"j\",\"jhtxfvgxbfsmxne\":\"bgsncghkjeszzhb\"},\"id\":\"mpvecxgodebfqk\",\"name\":\"rbmpukgri\",\"type\":\"flz\"}"; + = "{\"identity\":{\"principalId\":\"fu\",\"tenantId\":\"aodsfcpkv\",\"type\":\"SystemAssigned\"},\"properties\":{\"authentication\":{\"type\":\"zmyzydagf\",\"value\":\"xbezyiuokktwh\"},\"clusterExtensionIds\":[\"wz\"],\"displayName\":\"q\",\"hostResourceId\":\"bsureximo\",\"hostType\":\"Kubernetes\",\"namespace\":\"fsfksymddyst\",\"provisioningState\":\"iuxhqyudxorr\"},\"location\":\"b\",\"tags\":{\"llr\":\"zvyifqrvkdvj\",\"xxbczwtr\":\"vvdfwatkpnpul\"},\"id\":\"wiqzbqjvsovmyo\",\"name\":\"acspkwl\",\"type\":\"zdobpxjmflbvvnch\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,19 +33,19 @@ public void testGetByResourceGroupWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); CustomLocation response = manager.customLocations() - .getByResourceGroupWithResponse("mqhgyxzkonocuk", "klyaxuconu", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("yhltrpmopjmcm", "tuo", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("qxj", response.location()); - Assertions.assertEquals("j", response.tags().get("gidokgjljyoxgvcl")); + Assertions.assertEquals("b", response.location()); + Assertions.assertEquals("zvyifqrvkdvj", response.tags().get("llr")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("lrsf", response.authentication().type()); - Assertions.assertEquals("zpwv", response.authentication().value()); - Assertions.assertEquals("q", response.clusterExtensionIds().get(0)); - Assertions.assertEquals("tqhjfbebrjcx", response.displayName()); - Assertions.assertEquals("fuwutttxf", response.hostResourceId()); + Assertions.assertEquals("zmyzydagf", response.authentication().type()); + Assertions.assertEquals("xbezyiuokktwh", response.authentication().value()); + Assertions.assertEquals("wz", response.clusterExtensionIds().get(0)); + Assertions.assertEquals("q", response.displayName()); + Assertions.assertEquals("bsureximo", response.hostResourceId()); Assertions.assertEquals(HostType.KUBERNETES, response.hostType()); - Assertions.assertEquals("i", response.namespace()); - Assertions.assertEquals("hxepcyvahfnlj", response.provisioningState()); + Assertions.assertEquals("fsfksymddyst", response.namespace()); + Assertions.assertEquals("iuxhqyudxorr", response.provisioningState()); } } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupMockTests.java index 144525fba22e6..c67a84c1aa0e7 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListByResourceGroupMockTests.java @@ -24,7 +24,7 @@ public final class CustomLocationsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"bzoggigrx\",\"tenantId\":\"ur\",\"type\":\"None\"},\"properties\":{\"authentication\":{\"type\":\"spyd\",\"value\":\"koen\"},\"clusterExtensionIds\":[\"knvudwtiukb\",\"dng\",\"pocipazyxoegu\"],\"displayName\":\"jnpiucgyg\",\"hostResourceId\":\"qzntypm\",\"hostType\":\"Kubernetes\",\"namespace\":\"zcdrqjsdpydnfyhx\",\"provisioningState\":\"oejzi\"},\"location\":\"ifsjttgzfbishcb\",\"tags\":{\"alpbuxwgipwhon\":\"jdeyeamdpha\",\"kix\":\"wkgshwa\",\"eputtmrywnuzoqf\":\"bin\",\"qvyxlwhzlsicoho\":\"iyqzrnk\"},\"id\":\"qnwvlrya\",\"name\":\"w\",\"type\":\"heun\"}]}"; + = "{\"value\":[{\"identity\":{\"principalId\":\"asxazjpqyegualhb\",\"tenantId\":\"hejjz\",\"type\":\"None\"},\"properties\":{\"authentication\":{\"type\":\"wdslfhotwmcy\",\"value\":\"wlbjnpgacftade\"},\"clusterExtensionIds\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"],\"displayName\":\"dndnvow\",\"hostResourceId\":\"jjugwdkcglhslaz\",\"hostType\":\"Kubernetes\",\"namespace\":\"gdtjixhbkuofqwey\",\"provisioningState\":\"menevfyexfwh\"},\"location\":\"cibvyvdcsitynn\",\"tags\":{\"eypvhezrkg\":\"dectehfiqsc\",\"sle\":\"hcjrefovgmk\",\"cattpngjcrcczsq\":\"yvxyqjp\",\"mdajv\":\"jh\"},\"id\":\"ysou\",\"name\":\"q\",\"type\":\"canoaeupf\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,18 +34,18 @@ public void testListByResourceGroup() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.customLocations().listByResourceGroup("ithlvmezyvshxm", com.azure.core.util.Context.NONE); + = manager.customLocations().listByResourceGroup("jp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ifsjttgzfbishcb", response.iterator().next().location()); - Assertions.assertEquals("jdeyeamdpha", response.iterator().next().tags().get("alpbuxwgipwhon")); + Assertions.assertEquals("cibvyvdcsitynn", response.iterator().next().location()); + Assertions.assertEquals("dectehfiqsc", response.iterator().next().tags().get("eypvhezrkg")); Assertions.assertEquals(ResourceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("spyd", response.iterator().next().authentication().type()); - Assertions.assertEquals("koen", response.iterator().next().authentication().value()); - Assertions.assertEquals("knvudwtiukb", response.iterator().next().clusterExtensionIds().get(0)); - Assertions.assertEquals("jnpiucgyg", response.iterator().next().displayName()); - Assertions.assertEquals("qzntypm", response.iterator().next().hostResourceId()); + Assertions.assertEquals("wdslfhotwmcy", response.iterator().next().authentication().type()); + Assertions.assertEquals("wlbjnpgacftade", response.iterator().next().authentication().value()); + Assertions.assertEquals("ltyfsop", response.iterator().next().clusterExtensionIds().get(0)); + Assertions.assertEquals("dndnvow", response.iterator().next().displayName()); + Assertions.assertEquals("jjugwdkcglhslaz", response.iterator().next().hostResourceId()); Assertions.assertEquals(HostType.KUBERNETES, response.iterator().next().hostType()); - Assertions.assertEquals("zcdrqjsdpydnfyhx", response.iterator().next().namespace()); - Assertions.assertEquals("oejzi", response.iterator().next().provisioningState()); + Assertions.assertEquals("gdtjixhbkuofqwey", response.iterator().next().namespace()); + Assertions.assertEquals("menevfyexfwh", response.iterator().next().provisioningState()); } } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesMockTests.java index ca80d7ac0f6c8..c93daffe60ca8 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListEnabledResourceTypesMockTests.java @@ -22,7 +22,7 @@ public final class CustomLocationsListEnabledResourceTypesMockTests { @Test public void testListEnabledResourceTypes() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"clusterExtensionId\":\"hibnuqqkpika\",\"extensionType\":\"gvtqagnbuynh\",\"typesMetadata\":[{\"apiVersion\":\"mebf\",\"resourceProviderNamespace\":\"arbu\",\"resourceType\":\"cvpnazzmhjrunmpx\"}]},\"id\":\"dbhrbnlankxm\",\"name\":\"skpbhenbtkcxywn\",\"type\":\"tnrsyn\"}]}"; + = "{\"value\":[{\"properties\":{\"clusterExtensionId\":\"kg\",\"extensionType\":\"auu\",\"typesMetadata\":[{\"apiVersion\":\"vxieduugidyj\",\"resourceProviderNamespace\":\"f\",\"resourceType\":\"aos\"},{\"apiVersion\":\"xc\",\"resourceProviderNamespace\":\"npc\",\"resourceType\":\"ocohslkevleg\"}]},\"id\":\"fbuhfmvfaxkffe\",\"name\":\"ithlvmezyvshxm\",\"type\":\"sbbzo\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +32,12 @@ public void testListEnabledResourceTypes() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.customLocations() - .listEnabledResourceTypes("fbxzpuzycisp", "qzahmgkbrp", com.azure.core.util.Context.NONE); + .listEnabledResourceTypes("kcciwwzjuqkhr", "ajiwkuo", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hibnuqqkpika", response.iterator().next().clusterExtensionId()); - Assertions.assertEquals("gvtqagnbuynh", response.iterator().next().extensionType()); - Assertions.assertEquals("mebf", response.iterator().next().typesMetadata().get(0).apiVersion()); - Assertions.assertEquals("arbu", response.iterator().next().typesMetadata().get(0).resourceProviderNamespace()); - Assertions.assertEquals("cvpnazzmhjrunmpx", response.iterator().next().typesMetadata().get(0).resourceType()); + Assertions.assertEquals("kg", response.iterator().next().clusterExtensionId()); + Assertions.assertEquals("auu", response.iterator().next().extensionType()); + Assertions.assertEquals("vxieduugidyj", response.iterator().next().typesMetadata().get(0).apiVersion()); + Assertions.assertEquals("f", response.iterator().next().typesMetadata().get(0).resourceProviderNamespace()); + Assertions.assertEquals("aos", response.iterator().next().typesMetadata().get(0).resourceType()); } } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListMockTests.java index e94019b6fe8b4..d26ed440c72b8 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListMockTests.java @@ -24,7 +24,7 @@ public final class CustomLocationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"zvyifqrvkdvj\",\"tenantId\":\"lrmv\",\"type\":\"SystemAssigned\"},\"properties\":{\"authentication\":{\"type\":\"kpnpulexxbczwtr\",\"value\":\"iqzbq\"},\"clusterExtensionIds\":[\"ovm\",\"okacspk\",\"lhzdobp\",\"jmflbvvnch\"],\"displayName\":\"cciw\",\"hostResourceId\":\"juqk\",\"hostType\":\"Kubernetes\",\"namespace\":\"jiwkuofoskghsau\",\"provisioningState\":\"mjmvxieduugidyjr\"},\"location\":\"byao\",\"tags\":{\"onpc\":\"xc\"},\"id\":\"hocohslkev\",\"name\":\"eggzfb\",\"type\":\"hfmvfaxkffe\"}]}"; + = "{\"value\":[{\"identity\":{\"principalId\":\"ktzlcuiywg\",\"tenantId\":\"wgndrvynhzgpp\",\"type\":\"None\"},\"properties\":{\"authentication\":{\"type\":\"cocpecfvmmcoofsx\",\"value\":\"evgbmqjq\"},\"clusterExtensionIds\":[\"y\"],\"displayName\":\"ivkwlzuvccfwnfnb\",\"hostResourceId\":\"fionl\",\"hostType\":\"Kubernetes\",\"namespace\":\"tqgtzxdpnqbqq\",\"provisioningState\":\"rjfeallnwsubisnj\"},\"location\":\"pmng\",\"tags\":{\"aqw\":\"c\",\"xnj\":\"ochcbonqvpkvl\"},\"id\":\"ase\",\"name\":\"pheoflokeyy\",\"type\":\"enjbdlwtgrhp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,16 +35,16 @@ public void testList() throws Exception { PagedIterable response = manager.customLocations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("byao", response.iterator().next().location()); - Assertions.assertEquals("xc", response.iterator().next().tags().get("onpc")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("kpnpulexxbczwtr", response.iterator().next().authentication().type()); - Assertions.assertEquals("iqzbq", response.iterator().next().authentication().value()); - Assertions.assertEquals("ovm", response.iterator().next().clusterExtensionIds().get(0)); - Assertions.assertEquals("cciw", response.iterator().next().displayName()); - Assertions.assertEquals("juqk", response.iterator().next().hostResourceId()); + Assertions.assertEquals("pmng", response.iterator().next().location()); + Assertions.assertEquals("c", response.iterator().next().tags().get("aqw")); + Assertions.assertEquals(ResourceIdentityType.NONE, response.iterator().next().identity().type()); + Assertions.assertEquals("cocpecfvmmcoofsx", response.iterator().next().authentication().type()); + Assertions.assertEquals("evgbmqjq", response.iterator().next().authentication().value()); + Assertions.assertEquals("y", response.iterator().next().clusterExtensionIds().get(0)); + Assertions.assertEquals("ivkwlzuvccfwnfnb", response.iterator().next().displayName()); + Assertions.assertEquals("fionl", response.iterator().next().hostResourceId()); Assertions.assertEquals(HostType.KUBERNETES, response.iterator().next().hostType()); - Assertions.assertEquals("jiwkuofoskghsau", response.iterator().next().namespace()); - Assertions.assertEquals("mjmvxieduugidyjr", response.iterator().next().provisioningState()); + Assertions.assertEquals("tqgtzxdpnqbqq", response.iterator().next().namespace()); + Assertions.assertEquals("rjfeallnwsubisnj", response.iterator().next().provisioningState()); } } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsMockTests.java index 02fbe2484f7eb..abc2d1f483893 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsMockTests.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/CustomLocationsListOperationsMockTests.java @@ -21,7 +21,7 @@ public final class CustomLocationsListOperationsMockTests { @Test public void testListOperations() throws Exception { String responseStr - = "{\"value\":[{\"display\":{\"description\":\"yzydagfuaxbezyi\",\"operation\":\"kktwhrdxw\",\"provider\":\"wqsmbsur\",\"resource\":\"imoryocfsfksym\"},\"isDataAction\":false,\"name\":\"tki\",\"origin\":\"xhqyudxorrqnb\"}]}"; + = "{\"value\":[{\"display\":{\"description\":\"gug\",\"operation\":\"krxd\",\"provider\":\"i\",\"resource\":\"thz\"},\"isDataAction\":true,\"name\":\"rabhjybigeho\",\"origin\":\"bowsk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRuleListResultTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRuleListResultTests.java deleted file mode 100644 index 0a3b0341f39a5..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRuleListResultTests.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.extendedlocation.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.extendedlocation.models.ResourceSyncRuleListResult; - -public final class ResourceSyncRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSyncRuleListResult model = BinaryData.fromString( - "{\"nextLink\":\"jqabcypmivkwlzuv\",\"value\":[{\"properties\":{\"priority\":1023174750,\"provisioningState\":\"bacfionlebxetq\",\"selector\":{\"matchExpressions\":[{},{}],\"matchLabels\":{\"feallnwsu\":\"nqbqqwxr\",\"c\":\"isnjampmngnz\",\"ochcbonqvpkvl\":\"aqw\"}},\"targetResourceGroup\":\"njeaseipheofloke\"},\"location\":\"ienjbdlwtgr\",\"tags\":{\"umasxazjpq\":\"jp\",\"ualhbxxhejj\":\"e\",\"ynpwlbj\":\"zvdudgwdslfhotwm\",\"sop\":\"pgacftadehxnlty\"},\"id\":\"usue\",\"name\":\"nzwdejba\",\"type\":\"orxzdmohctbqvud\"},{\"properties\":{\"priority\":1222672575,\"provisioningState\":\"nvowgujju\",\"selector\":{\"matchExpressions\":[{},{},{}],\"matchLabels\":{\"xhbkuofq\":\"lhslazjdyggdtj\",\"kh\":\"e\"}},\"targetResourceGroup\":\"n\"},\"location\":\"fyexfwhy\",\"tags\":{\"naamde\":\"bvyvdcsity\"},\"id\":\"tehfiqscjeypvh\",\"name\":\"zrkgqhcjrefovg\",\"type\":\"kqsleyyvxy\"}]}") - .toObject(ResourceSyncRuleListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSyncRuleListResult model = new ResourceSyncRuleListResult(); - model = BinaryData.fromObject(model).toObject(ResourceSyncRuleListResult.class); - } -} diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteWithResponseMockTests.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteWithResponseMockTests.java deleted file mode 100644 index fc5bf41dc2a65..0000000000000 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/test/java/com/azure/resourcemanager/extendedlocation/generated/ResourceSyncRulesDeleteWithResponseMockTests.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.extendedlocation.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.extendedlocation.CustomLocationsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceSyncRulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CustomLocationsManager manager = CustomLocationsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.resourceSyncRules() - .deleteWithResponse("vmeueci", "yhz", "euojgjrwju", com.azure.core.util.Context.NONE); - - } -}