From 5eae0e37753d5095413310adbe92d4bd1f77012c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 May 2023 18:02:29 +0000 Subject: [PATCH] CodeGen from PR 24171 in Azure/azure-rest-api-specs Merge 29e55ba44ca7c06b8c07ab4a524971d880b086e8 into be63fad20943ff5f1cdf9849d2631839b683935a --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 252 ++- .../pom.xml | 10 +- .../mixedreality/MixedRealityManager.java | 18 +- .../fluent/MixedRealityClient.java | 7 + .../fluent/ObjectAnchorsAccountsClient.java | 238 +++ .../models/ObjectAnchorsAccountInner.java | 234 +++ .../MixedRealityClientImpl.java | 16 +- .../ObjectAnchorsAccountImpl.java | 249 +++ .../ObjectAnchorsAccountsClientImpl.java | 1569 +++++++++++++++++ .../ObjectAnchorsAccountsImpl.java | 235 +++ .../RemoteRenderingAccountsClientImpl.java | 21 +- .../ResourceProvidersClientImpl.java | 3 +- .../SpatialAnchorsAccountsClientImpl.java | 21 +- .../models/AccountKeyRegenerateRequest.java | 6 +- .../mixedreality/models/MetricDimension.java | 8 +- .../models/ObjectAnchorsAccount.java | 414 +++++ .../models/ObjectAnchorsAccountIdentity.java | 32 + .../models/ObjectAnchorsAccountPage.java | 84 + .../models/ObjectAnchorsAccounts.java | 211 +++ .../mixedreality/models/Serial.java | 2 +- .../ObjectAnchorsAccountsCreateSamples.java | 29 + .../ObjectAnchorsAccountsDeleteSamples.java | 22 + ...horsAccountsGetByResourceGroupSamples.java | 22 + ...orsAccountsListByResourceGroupSamples.java | 21 + .../ObjectAnchorsAccountsListKeysSamples.java | 22 + .../ObjectAnchorsAccountsListSamples.java | 21 + ...tAnchorsAccountsRegenerateKeysSamples.java | 30 + .../ObjectAnchorsAccountsUpdateSamples.java | 46 + .../generated/OperationsListSamples.java | 2 +- .../RemoteRenderingAccountsCreateSamples.java | 2 +- .../RemoteRenderingAccountsDeleteSamples.java | 2 +- ...ringAccountsGetByResourceGroupSamples.java | 2 +- ...ingAccountsListByResourceGroupSamples.java | 2 +- ...emoteRenderingAccountsListKeysSamples.java | 2 +- .../RemoteRenderingAccountsListSamples.java | 2 +- ...enderingAccountsRegenerateKeysSamples.java | 2 +- .../RemoteRenderingAccountsUpdateSamples.java | 2 +- ...iderCheckNameAvailabilityLocalSamples.java | 2 +- .../SpatialAnchorsAccountsCreateSamples.java | 2 +- .../SpatialAnchorsAccountsDeleteSamples.java | 2 +- ...horsAccountsGetByResourceGroupSamples.java | 2 +- ...orsAccountsListByResourceGroupSamples.java | 2 +- ...SpatialAnchorsAccountsListKeysSamples.java | 2 +- .../SpatialAnchorsAccountsListSamples.java | 2 +- ...lAnchorsAccountsRegenerateKeysSamples.java | 2 +- .../SpatialAnchorsAccountsUpdateSamples.java | 2 +- .../AccountKeyRegenerateRequestTests.java | 26 - .../CheckNameAvailabilityRequestTests.java | 30 - ...eckNameAvailabilityResponseInnerTests.java | 36 - .../mixedreality/generated/IdentityTests.java | 29 - .../generated/LogSpecificationTests.java | 32 - .../generated/MetricDimensionTests.java | 39 - .../generated/MetricSpecificationTests.java | 90 - .../MixedRealityAccountPropertiesTests.java | 28 - .../generated/OperationDisplayTests.java | 39 - .../generated/OperationInnerTests.java | 60 - .../generated/OperationPageTests.java | 84 - .../generated/OperationPropertiesTests.java | 162 -- .../generated/OperationsListMockTests.java | 73 - .../RemoteRenderingAccountInnerTests.java | 93 - .../RemoteRenderingAccountPageTests.java | 180 -- ...ngAccountsCreateWithResponseMockTests.java | 121 -- ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 86 - ...gAccountsListByResourceGroupMockTests.java | 84 - .../RemoteRenderingAccountsListMockTests.java | 84 - ...vailabilityLocalWithResponseMockTests.java | 76 - .../generated/ServiceSpecificationTests.java | 121 -- .../mixedreality/generated/SkuTests.java | 43 - .../SpatialAnchorsAccountInnerTests.java | 102 -- .../SpatialAnchorsAccountPageTests.java | 180 -- ...rsAccountsCreateWithResponseMockTests.java | 121 -- ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 86 - ...sAccountsListByResourceGroupMockTests.java | 84 - .../SpatialAnchorsAccountsListMockTests.java | 84 - 78 files changed, 3805 insertions(+), 2481 deletions(-) create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ObjectAnchorsAccountsClient.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/ObjectAnchorsAccountInner.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountImpl.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsClientImpl.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsImpl.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccount.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountIdentity.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountPage.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccounts.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsCreateSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsDeleteSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsGetByResourceGroupSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListByResourceGroupSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListKeysSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsRegenerateKeysSamples.java create mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsUpdateSamples.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java delete mode 100644 sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md index 695266b4f0bb8..8243ddfa4f1e9 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-05-25) + +- Azure Resource Manager MixedReality client library for Java. This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md index 2f116ea323423..f680b65af170c 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/README.md @@ -2,7 +2,7 @@ Azure Resource Manager MixedReality client library for Java. -This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MixedReality Management SDK. Mixed Reality Client. Package tag package-2021-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mixedreality - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md b/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md index e0373d9de0c99..5000d3b0b0e62 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/SAMPLE.md @@ -1,6 +1,17 @@ # Code snippets and samples +## ObjectAnchorsAccounts + +- [Create](#objectanchorsaccounts_create) +- [Delete](#objectanchorsaccounts_delete) +- [GetByResourceGroup](#objectanchorsaccounts_getbyresourcegroup) +- [List](#objectanchorsaccounts_list) +- [ListByResourceGroup](#objectanchorsaccounts_listbyresourcegroup) +- [ListKeys](#objectanchorsaccounts_listkeys) +- [RegenerateKeys](#objectanchorsaccounts_regeneratekeys) +- [Update](#objectanchorsaccounts_update) + ## Operations - [List](#operations_list) @@ -30,13 +41,218 @@ - [ListKeys](#spatialanchorsaccounts_listkeys) - [RegenerateKeys](#spatialanchorsaccounts_regeneratekeys) - [Update](#spatialanchorsaccounts_update) +### ObjectAnchorsAccounts_Create + +```java +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; + +/** Samples for ObjectAnchorsAccounts Create. */ +public final class ObjectAnchorsAccountsCreateSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Put.json + */ + /** + * Sample code: Create object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void createObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .define("MyAccount") + .withRegion("eastus2euap") + .withExistingResourceGroup("MyResourceGroup") + .withIdentity(new ObjectAnchorsAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } +} +``` + +### ObjectAnchorsAccounts_Delete + +```java +/** Samples for ObjectAnchorsAccounts Delete. */ +public final class ObjectAnchorsAccountsDeleteSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Delete.json + */ + /** + * Sample code: Delete object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void deleteObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_GetByResourceGroup + +```java +/** Samples for ObjectAnchorsAccounts GetByResourceGroup. */ +public final class ObjectAnchorsAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Get.json + */ + /** + * Sample code: Get object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void getObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_List + +```java +/** Samples for ObjectAnchorsAccounts List. */ +public final class ObjectAnchorsAccountsListSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/GetBySubscription.json + */ + /** + * Sample code: List object anchors accounts by subscription. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountsBySubscription( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager.objectAnchorsAccounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_ListByResourceGroup + +```java +/** Samples for ObjectAnchorsAccounts ListByResourceGroup. */ +public final class ObjectAnchorsAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/GetByResourceGroup.json + */ + /** + * Sample code: List object anchors accounts by resource group. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountsByResourceGroup( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager.objectAnchorsAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_ListKeys + +```java +/** Samples for ObjectAnchorsAccounts ListKeys. */ +public final class ObjectAnchorsAccountsListKeysSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/ListKeys.json + */ + /** + * Sample code: List object anchors account key. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_RegenerateKeys + +```java +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; +import com.azure.resourcemanager.mixedreality.models.Serial; + +/** Samples for ObjectAnchorsAccounts RegenerateKeys. */ +public final class ObjectAnchorsAccountsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/RegenerateKey.json + */ + /** + * Sample code: Regenerate object anchors account keys. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void regenerateObjectAnchorsAccountKeys( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .regenerateKeysWithResponse( + "MyResourceGroup", + "MyAccount", + new AccountKeyRegenerateRequest().withSerial(Serial.ONE), + com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectAnchorsAccounts_Update + +```java +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccount; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ObjectAnchorsAccounts Update. */ +public final class ObjectAnchorsAccountsUpdateSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Patch.json + */ + /** + * Sample code: Update object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void updateObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + ObjectAnchorsAccount resource = + manager + .objectAnchorsAccounts() + .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("hero", "romeo", "heroine", "juliet")) + .withIdentity(new ObjectAnchorsAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### Operations_List ```java /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ExposingAvailableOperations.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/proxy/ExposingAvailableOperations.json */ /** * Sample code: List available operations. @@ -58,7 +274,7 @@ import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; /** Samples for RemoteRenderingAccounts Create. */ public final class RemoteRenderingAccountsCreateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Put.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Put.json */ /** * Sample code: Create remote rendering account. @@ -84,7 +300,7 @@ public final class RemoteRenderingAccountsCreateSamples { /** Samples for RemoteRenderingAccounts Delete. */ public final class RemoteRenderingAccountsDeleteSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Delete.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Delete.json */ /** * Sample code: Delete remote rendering account. @@ -106,7 +322,7 @@ public final class RemoteRenderingAccountsDeleteSamples { /** Samples for RemoteRenderingAccounts GetByResourceGroup. */ public final class RemoteRenderingAccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Get.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Get.json */ /** * Sample code: Get remote rendering account. @@ -127,7 +343,7 @@ public final class RemoteRenderingAccountsGetByResourceGroupSamples { /** Samples for RemoteRenderingAccounts List. */ public final class RemoteRenderingAccountsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/GetBySubscription.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/GetBySubscription.json */ /** * Sample code: List remote rendering accounts by subscription. @@ -147,7 +363,7 @@ public final class RemoteRenderingAccountsListSamples { /** Samples for RemoteRenderingAccounts ListByResourceGroup. */ public final class RemoteRenderingAccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/GetByResourceGroup.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/GetByResourceGroup.json */ /** * Sample code: List remote rendering accounts by resource group. @@ -167,7 +383,7 @@ public final class RemoteRenderingAccountsListByResourceGroupSamples { /** Samples for RemoteRenderingAccounts ListKeys. */ public final class RemoteRenderingAccountsListKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ListKeys.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/ListKeys.json */ /** * Sample code: List remote rendering account key. @@ -192,7 +408,7 @@ import com.azure.resourcemanager.mixedreality.models.Serial; /** Samples for RemoteRenderingAccounts RegenerateKeys. */ public final class RemoteRenderingAccountsRegenerateKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/RegenerateKey.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/RegenerateKey.json */ /** * Sample code: Regenerate remote rendering account keys. @@ -224,7 +440,7 @@ import java.util.Map; /** Samples for RemoteRenderingAccounts Update. */ public final class RemoteRenderingAccountsUpdateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Patch.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Patch.json */ /** * Sample code: Update remote rendering account. @@ -266,7 +482,7 @@ import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityReques /** Samples for ResourceProvider CheckNameAvailabilityLocal. */ public final class ResourceProviderCheckNameAvailabilityLocalSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/CheckNameAvailabilityForLocalUniqueness.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/proxy/CheckNameAvailabilityForLocalUniqueness.json */ /** * Sample code: CheckLocalNameAvailability. @@ -292,7 +508,7 @@ public final class ResourceProviderCheckNameAvailabilityLocalSamples { /** Samples for SpatialAnchorsAccounts Create. */ public final class SpatialAnchorsAccountsCreateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Put.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Put.json */ /** * Sample code: Create spatial anchor account. @@ -316,7 +532,7 @@ public final class SpatialAnchorsAccountsCreateSamples { /** Samples for SpatialAnchorsAccounts Delete. */ public final class SpatialAnchorsAccountsDeleteSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Delete.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Delete.json */ /** * Sample code: Delete spatial anchors account. @@ -337,7 +553,7 @@ public final class SpatialAnchorsAccountsDeleteSamples { /** Samples for SpatialAnchorsAccounts GetByResourceGroup. */ public final class SpatialAnchorsAccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Get.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Get.json */ /** * Sample code: Get spatial anchors account. @@ -358,7 +574,7 @@ public final class SpatialAnchorsAccountsGetByResourceGroupSamples { /** Samples for SpatialAnchorsAccounts List. */ public final class SpatialAnchorsAccountsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/GetBySubscription.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/GetBySubscription.json */ /** * Sample code: List spatial anchors accounts by subscription. @@ -378,7 +594,7 @@ public final class SpatialAnchorsAccountsListSamples { /** Samples for SpatialAnchorsAccounts ListByResourceGroup. */ public final class SpatialAnchorsAccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/GetByResourceGroup.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/GetByResourceGroup.json */ /** * Sample code: List spatial anchor accounts by resource group. @@ -398,7 +614,7 @@ public final class SpatialAnchorsAccountsListByResourceGroupSamples { /** Samples for SpatialAnchorsAccounts ListKeys. */ public final class SpatialAnchorsAccountsListKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ListKeys.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/ListKeys.json */ /** * Sample code: List spatial anchor account key. @@ -422,7 +638,7 @@ import com.azure.resourcemanager.mixedreality.models.Serial; /** Samples for SpatialAnchorsAccounts RegenerateKeys. */ public final class SpatialAnchorsAccountsRegenerateKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/RegenerateKey.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/RegenerateKey.json */ /** * Sample code: Regenerate spatial anchors account keys. @@ -452,7 +668,7 @@ import java.util.Map; /** Samples for SpatialAnchorsAccounts Update. */ public final class SpatialAnchorsAccountsUpdateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Patch.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Patch.json */ /** * Sample code: Update spatial anchors account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml b/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml index 530b4a1c05e42..48587104e59fd 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for MixedReality Management - This package contains Microsoft Azure SDK for MixedReality Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Mixed Reality Client. Package tag package-2021-01. + This package contains Microsoft Azure SDK for MixedReality Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Mixed Reality Client. Package tag package-2021-03-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java index fa691a9bdbae2..378a6afce4639 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/MixedRealityManager.java @@ -25,10 +25,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mixedreality.fluent.MixedRealityClient; import com.azure.resourcemanager.mixedreality.implementation.MixedRealityClientBuilder; +import com.azure.resourcemanager.mixedreality.implementation.ObjectAnchorsAccountsImpl; import com.azure.resourcemanager.mixedreality.implementation.OperationsImpl; import com.azure.resourcemanager.mixedreality.implementation.RemoteRenderingAccountsImpl; import com.azure.resourcemanager.mixedreality.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.mixedreality.implementation.SpatialAnchorsAccountsImpl; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccounts; import com.azure.resourcemanager.mixedreality.models.Operations; import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccounts; import com.azure.resourcemanager.mixedreality.models.ResourceProviders; @@ -50,6 +52,8 @@ public final class MixedRealityManager { private RemoteRenderingAccounts remoteRenderingAccounts; + private ObjectAnchorsAccounts objectAnchorsAccounts; + private final MixedRealityClient clientObject; private MixedRealityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +219,7 @@ public MixedRealityManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.mixedreality") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -322,6 +326,18 @@ public RemoteRenderingAccounts remoteRenderingAccounts() { return remoteRenderingAccounts; } + /** + * Gets the resource collection API of ObjectAnchorsAccounts. It manages ObjectAnchorsAccount. + * + * @return Resource collection API of ObjectAnchorsAccounts. + */ + public ObjectAnchorsAccounts objectAnchorsAccounts() { + if (this.objectAnchorsAccounts == null) { + this.objectAnchorsAccounts = new ObjectAnchorsAccountsImpl(clientObject.getObjectAnchorsAccounts(), this); + } + return objectAnchorsAccounts; + } + /** * @return Wrapped service client MixedRealityClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java index 83ac188059365..14ab8e52adcdd 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/MixedRealityClient.java @@ -71,4 +71,11 @@ public interface MixedRealityClient { * @return the RemoteRenderingAccountsClient object. */ RemoteRenderingAccountsClient getRemoteRenderingAccounts(); + + /** + * Gets the ObjectAnchorsAccountsClient object to access its operations. + * + * @return the ObjectAnchorsAccountsClient object. + */ + ObjectAnchorsAccountsClient getObjectAnchorsAccounts(); } diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ObjectAnchorsAccountsClient.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ObjectAnchorsAccountsClient.java new file mode 100644 index 0000000000000..93488adbd01c1 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/ObjectAnchorsAccountsClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; +import com.azure.resourcemanager.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; + +/** An instance of this class provides access to all the operations defined in ObjectAnchorsAccountsClient. */ +public interface ObjectAnchorsAccountsClient { + /** + * List Object Anchors Accounts by Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Object Anchors Accounts by Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accountName); + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectAnchorsAccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, Context context); + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectAnchorsAccountInner update( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount); + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, Context context); + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectAnchorsAccountInner create( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountKeysInner listKeys(String resourceGroupName, String accountName); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, Context context); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountKeysInner regenerateKeys( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate); +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/ObjectAnchorsAccountInner.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/ObjectAnchorsAccountInner.java new file mode 100644 index 0000000000000..7356f455832e1 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/models/ObjectAnchorsAccountInner.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.mixedreality.models.Identity; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** ObjectAnchorsAccount Response. */ +@Fluent +public final class ObjectAnchorsAccountInner extends Resource { + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private ObjectAnchorsAccountIdentity identity; + + /* + * Property bag. + */ + @JsonProperty(value = "properties") + private MixedRealityAccountProperties innerProperties; + + /* + * The plan associated with this account + */ + @JsonProperty(value = "plan") + private Identity plan; + + /* + * The sku associated with this account + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The kind of account, if supported + */ + @JsonProperty(value = "kind") + private Sku kind; + + /* + * The system metadata related to an object anchors account. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ObjectAnchorsAccountInner class. */ + public ObjectAnchorsAccountInner() { + } + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public ObjectAnchorsAccountIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the ObjectAnchorsAccountInner object itself. + */ + public ObjectAnchorsAccountInner withIdentity(ObjectAnchorsAccountIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: Property bag. + * + * @return the innerProperties value. + */ + private MixedRealityAccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the plan property: The plan associated with this account. + * + * @return the plan value. + */ + public Identity plan() { + return this.plan; + } + + /** + * Set the plan property: The plan associated with this account. + * + * @param plan the plan value to set. + * @return the ObjectAnchorsAccountInner object itself. + */ + public ObjectAnchorsAccountInner withPlan(Identity plan) { + this.plan = plan; + return this; + } + + /** + * Get the sku property: The sku associated with this account. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku associated with this account. + * + * @param sku the sku value to set. + * @return the ObjectAnchorsAccountInner object itself. + */ + public ObjectAnchorsAccountInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: The kind of account, if supported. + * + * @return the kind value. + */ + public Sku kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of account, if supported. + * + * @param kind the kind value to set. + * @return the ObjectAnchorsAccountInner object itself. + */ + public ObjectAnchorsAccountInner withKind(Sku kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: The system metadata related to an object anchors account. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ObjectAnchorsAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ObjectAnchorsAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the storageAccountName property: The name of the storage account associated with this accountId. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountName(); + } + + /** + * Set the storageAccountName property: The name of the storage account associated with this accountId. + * + * @param storageAccountName the storageAccountName value to set. + * @return the ObjectAnchorsAccountInner object itself. + */ + public ObjectAnchorsAccountInner withStorageAccountName(String storageAccountName) { + if (this.innerProperties() == null) { + this.innerProperties = new MixedRealityAccountProperties(); + } + this.innerProperties().withStorageAccountName(storageAccountName); + return this; + } + + /** + * Get the accountId property: unique id of certain account. + * + * @return the accountId value. + */ + public String accountId() { + return this.innerProperties() == null ? null : this.innerProperties().accountId(); + } + + /** + * Get the accountDomain property: Correspond domain name of certain Spatial Anchors Account. + * + * @return the accountDomain value. + */ + public String accountDomain() { + return this.innerProperties() == null ? null : this.innerProperties().accountDomain(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (kind() != null) { + kind().validate(); + } + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java index 7fec9d8ac8993..1cb65f4718079 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/MixedRealityClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.mixedreality.fluent.MixedRealityClient; +import com.azure.resourcemanager.mixedreality.fluent.ObjectAnchorsAccountsClient; import com.azure.resourcemanager.mixedreality.fluent.OperationsClient; import com.azure.resourcemanager.mixedreality.fluent.RemoteRenderingAccountsClient; import com.azure.resourcemanager.mixedreality.fluent.ResourceProvidersClient; @@ -159,6 +160,18 @@ public RemoteRenderingAccountsClient getRemoteRenderingAccounts() { return this.remoteRenderingAccounts; } + /** The ObjectAnchorsAccountsClient object to access its operations. */ + private final ObjectAnchorsAccountsClient objectAnchorsAccounts; + + /** + * Gets the ObjectAnchorsAccountsClient object to access its operations. + * + * @return the ObjectAnchorsAccountsClient object. + */ + public ObjectAnchorsAccountsClient getObjectAnchorsAccounts() { + return this.objectAnchorsAccounts; + } + /** * Initializes an instance of MixedRealityClient client. * @@ -182,11 +195,12 @@ public RemoteRenderingAccountsClient getRemoteRenderingAccounts() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-01"; + this.apiVersion = "2021-03-01-preview"; this.operations = new OperationsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); this.spatialAnchorsAccounts = new SpatialAnchorsAccountsClientImpl(this); this.remoteRenderingAccounts = new RemoteRenderingAccountsClientImpl(this); + this.objectAnchorsAccounts = new ObjectAnchorsAccountsClientImpl(this); } /** diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountImpl.java new file mode 100644 index 0000000000000..68135b3640b17 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; +import com.azure.resourcemanager.mixedreality.models.AccountKeys; +import com.azure.resourcemanager.mixedreality.models.Identity; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccount; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class ObjectAnchorsAccountImpl + implements ObjectAnchorsAccount, ObjectAnchorsAccount.Definition, ObjectAnchorsAccount.Update { + private ObjectAnchorsAccountInner innerObject; + + private final com.azure.resourcemanager.mixedreality.MixedRealityManager 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 ObjectAnchorsAccountIdentity identity() { + return this.innerModel().identity(); + } + + public Identity plan() { + return this.innerModel().plan(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Sku kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String storageAccountName() { + return this.innerModel().storageAccountName(); + } + + public String accountId() { + return this.innerModel().accountId(); + } + + public String accountDomain() { + return this.innerModel().accountDomain(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ObjectAnchorsAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public ObjectAnchorsAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ObjectAnchorsAccount create() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .createWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ObjectAnchorsAccount create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .createWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + ObjectAnchorsAccountImpl(String name, com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { + this.innerObject = new ObjectAnchorsAccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public ObjectAnchorsAccountImpl update() { + return this; + } + + public ObjectAnchorsAccount apply() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .updateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ObjectAnchorsAccount apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .updateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + ObjectAnchorsAccountImpl( + ObjectAnchorsAccountInner innerObject, + com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "objectAnchorsAccounts"); + } + + public ObjectAnchorsAccount refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public ObjectAnchorsAccount refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectAnchorsAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(Context context) { + return serviceManager.objectAnchorsAccounts().listKeysWithResponse(resourceGroupName, accountName, context); + } + + public AccountKeys listKeys() { + return serviceManager.objectAnchorsAccounts().listKeys(resourceGroupName, accountName); + } + + public Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context) { + return serviceManager + .objectAnchorsAccounts() + .regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); + } + + public AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate) { + return serviceManager.objectAnchorsAccounts().regenerateKeys(resourceGroupName, accountName, regenerate); + } + + public ObjectAnchorsAccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ObjectAnchorsAccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ObjectAnchorsAccountImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ObjectAnchorsAccountImpl withIdentity(ObjectAnchorsAccountIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ObjectAnchorsAccountImpl withPlan(Identity plan) { + this.innerModel().withPlan(plan); + return this; + } + + public ObjectAnchorsAccountImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ObjectAnchorsAccountImpl withKind(Sku kind) { + this.innerModel().withKind(kind); + return this; + } + + public ObjectAnchorsAccountImpl withStorageAccountName(String storageAccountName) { + this.innerModel().withStorageAccountName(storageAccountName); + return this; + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsClientImpl.java new file mode 100644 index 0000000000000..857e8812144d4 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsClientImpl.java @@ -0,0 +1,1569 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.mixedreality.fluent.ObjectAnchorsAccountsClient; +import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; +import com.azure.resourcemanager.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountPage; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ObjectAnchorsAccountsClient. */ +public final class ObjectAnchorsAccountsClientImpl implements ObjectAnchorsAccountsClient { + /** The proxy service used to perform REST calls. */ + private final ObjectAnchorsAccountsService service; + + /** The service client containing this operation class. */ + private final MixedRealityClientImpl client; + + /** + * Initializes an instance of ObjectAnchorsAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ObjectAnchorsAccountsClientImpl(MixedRealityClientImpl client) { + this.service = + RestProxy + .create(ObjectAnchorsAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MixedRealityClientObjectAnchorsAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MixedRealityClientOb") + public interface ObjectAnchorsAccountsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/objectAnchorsAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ObjectAnchorsAccountInner objectAnchorsAccount, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ObjectAnchorsAccountInner objectAnchorsAccount, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountKeyRegenerateRequest regenerate, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Object Anchors Accounts by Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 accountName) { + deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectAnchorsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (objectAnchorsAccount == null) { + return Mono + .error(new IllegalArgumentException("Parameter objectAnchorsAccount is required and cannot be null.")); + } else { + objectAnchorsAccount.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + objectAnchorsAccount, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (objectAnchorsAccount == null) { + return Mono + .error(new IllegalArgumentException("Parameter objectAnchorsAccount is required and cannot be null.")); + } else { + objectAnchorsAccount.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + objectAnchorsAccount, + accept, + context); + } + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + return updateWithResponseAsync(resourceGroupName, accountName, objectAnchorsAccount) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, objectAnchorsAccount, context).block(); + } + + /** + * Updating an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectAnchorsAccountInner update( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + return updateWithResponse(resourceGroupName, accountName, objectAnchorsAccount, Context.NONE).getValue(); + } + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (objectAnchorsAccount == null) { + return Mono + .error(new IllegalArgumentException("Parameter objectAnchorsAccount is required and cannot be null.")); + } else { + objectAnchorsAccount.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + objectAnchorsAccount, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (objectAnchorsAccount == null) { + return Mono + .error(new IllegalArgumentException("Parameter objectAnchorsAccount is required and cannot be null.")); + } else { + objectAnchorsAccount.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + objectAnchorsAccount, + accept, + context); + } + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + return createWithResponseAsync(resourceGroupName, accountName, objectAnchorsAccount) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, objectAnchorsAccount, context).block(); + } + + /** + * Creating or Updating an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param objectAnchorsAccount Object Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectAnchorsAccountInner create( + String resourceGroupName, String accountName, ObjectAnchorsAccountInner objectAnchorsAccount) { + return createWithResponse(resourceGroupName, accountName, objectAnchorsAccount, Context.NONE).getValue(); + } + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String accountName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountKeysInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (regenerate == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); + } else { + regenerate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + regenerate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (regenerate == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null.")); + } else { + regenerate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + regenerate, + accept, + context); + } + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) { + return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, Context context) { + return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate, context).block(); + } + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountKeysInner regenerateKeys( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) { + return regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsImpl.java new file mode 100644 index 0000000000000..87ce30b50da13 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ObjectAnchorsAccountsImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.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.mixedreality.fluent.ObjectAnchorsAccountsClient; +import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner; +import com.azure.resourcemanager.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; +import com.azure.resourcemanager.mixedreality.models.AccountKeys; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccount; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccounts; + +public final class ObjectAnchorsAccountsImpl implements ObjectAnchorsAccounts { + private static final ClientLogger LOGGER = new ClientLogger(ObjectAnchorsAccountsImpl.class); + + private final ObjectAnchorsAccountsClient innerClient; + + private final com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager; + + public ObjectAnchorsAccountsImpl( + ObjectAnchorsAccountsClient innerClient, + com.azure.resourcemanager.mixedreality.MixedRealityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ObjectAnchorsAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ObjectAnchorsAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ObjectAnchorsAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ObjectAnchorsAccountImpl(inner1, this.manager())); + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ObjectAnchorsAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ObjectAnchorsAccount getByResourceGroup(String resourceGroupName, String accountName) { + ObjectAnchorsAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new ObjectAnchorsAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccountKeys listKeys(String resourceGroupName, String accountName) { + AccountKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); + if (inner != null) { + return new AccountKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, Context context) { + Response inner = + this.serviceClient().regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccountKeys regenerateKeys( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) { + AccountKeysInner inner = this.serviceClient().regenerateKeys(resourceGroupName, accountName, regenerate); + if (inner != null) { + return new AccountKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public ObjectAnchorsAccount getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "objectAnchorsAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectAnchorsAccounts'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "objectAnchorsAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectAnchorsAccounts'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "objectAnchorsAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectAnchorsAccounts'.", + id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "objectAnchorsAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectAnchorsAccounts'.", + id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + private ObjectAnchorsAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mixedreality.MixedRealityManager manager() { + return this.serviceManager; + } + + public ObjectAnchorsAccountImpl define(String name) { + return new ObjectAnchorsAccountImpl(name, this.manager()); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java index 40ade8a48bb34..dcfac57338656 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/RemoteRenderingAccountsClientImpl.java @@ -77,8 +77,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -91,8 +90,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -106,8 +104,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -121,8 +118,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -137,8 +133,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @@ -153,8 +148,7 @@ Mono> create( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @@ -168,8 +162,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/remoteRenderingAccounts/{accountName}/regenerateKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> regenerateKeys( diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java index e6966c64ff425..359b33381e391 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/ResourceProvidersClientImpl.java @@ -55,8 +55,7 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien public interface ResourceProvidersService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}" - + "/checkNameAvailability") + "/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailabilityLocal( diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java index 651c94bf60a36..f5fad8ba849ef 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/implementation/SpatialAnchorsAccountsClientImpl.java @@ -77,8 +77,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -91,8 +90,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -106,8 +104,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -121,8 +118,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -137,8 +133,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @@ -153,8 +148,7 @@ Mono> create( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @@ -168,8 +162,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality" - + "/spatialAnchorsAccounts/{accountName}/regenerateKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> regenerateKeys( diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java index 6a1521948fcdb..591db81663855 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/AccountKeyRegenerateRequest.java @@ -11,7 +11,7 @@ @Fluent public final class AccountKeyRegenerateRequest { /* - * serial of key to be regenerated + * Serial of key to be regenerated */ @JsonProperty(value = "serial") private Serial serial; @@ -21,7 +21,7 @@ public AccountKeyRegenerateRequest() { } /** - * Get the serial property: serial of key to be regenerated. + * Get the serial property: Serial of key to be regenerated. * * @return the serial value. */ @@ -30,7 +30,7 @@ public Serial serial() { } /** - * Set the serial property: serial of key to be regenerated. + * Set the serial property: Serial of key to be regenerated. * * @param serial the serial value to set. * @return the AccountKeyRegenerateRequest object itself. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java index a522f04a28bbb..4c16593e1333c 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/MetricDimension.java @@ -29,7 +29,7 @@ public final class MetricDimension { private String internalName; /* - * Whether the dimension should be included for the shoebox export scenario. + * Flag to indicate export for Shoebox */ @JsonProperty(value = "toBeExportedForShoebox") private Boolean toBeExportedForShoebox; @@ -99,8 +99,7 @@ public MetricDimension withInternalName(String internalName) { } /** - * Get the toBeExportedForShoebox property: Whether the dimension should be included for the shoebox export - * scenario. + * Get the toBeExportedForShoebox property: Flag to indicate export for Shoebox. * * @return the toBeExportedForShoebox value. */ @@ -109,8 +108,7 @@ public Boolean toBeExportedForShoebox() { } /** - * Set the toBeExportedForShoebox property: Whether the dimension should be included for the shoebox export - * scenario. + * Set the toBeExportedForShoebox property: Flag to indicate export for Shoebox. * * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. * @return the MetricDimension object itself. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccount.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccount.java new file mode 100644 index 0000000000000..87cdf22fcda41 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccount.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import java.util.Map; + +/** An immutable client-side representation of ObjectAnchorsAccount. */ +public interface ObjectAnchorsAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The identity property. + * + * @return the identity value. + */ + ObjectAnchorsAccountIdentity identity(); + + /** + * Gets the plan property: The plan associated with this account. + * + * @return the plan value. + */ + Identity plan(); + + /** + * Gets the sku property: The sku associated with this account. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the kind property: The kind of account, if supported. + * + * @return the kind value. + */ + Sku kind(); + + /** + * Gets the systemData property: The system metadata related to an object anchors account. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the storageAccountName property: The name of the storage account associated with this accountId. + * + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * Gets the accountId property: unique id of certain account. + * + * @return the accountId value. + */ + String accountId(); + + /** + * Gets the accountDomain property: Correspond domain name of certain Spatial Anchors Account. + * + * @return the accountDomain value. + */ + String accountDomain(); + + /** + * 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.mixedreality.fluent.models.ObjectAnchorsAccountInner object. + * + * @return the inner object. + */ + ObjectAnchorsAccountInner innerModel(); + + /** The entirety of the ObjectAnchorsAccount definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ObjectAnchorsAccount definition stages. */ + interface DefinitionStages { + /** The first stage of the ObjectAnchorsAccount definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of an Azure resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ObjectAnchorsAccount definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithPlan, + DefinitionStages.WithSku, + DefinitionStages.WithKind, + DefinitionStages.WithStorageAccountName { + /** + * Executes the create request. + * + * @return the created resource. + */ + ObjectAnchorsAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ObjectAnchorsAccount create(Context context); + } + /** The stage of the ObjectAnchorsAccount 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 ObjectAnchorsAccount definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity property.. + * + * @param identity The identity property. + * @return the next definition stage. + */ + WithCreate withIdentity(ObjectAnchorsAccountIdentity identity); + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: The plan associated with this account. + * + * @param plan The plan associated with this account. + * @return the next definition stage. + */ + WithCreate withPlan(Identity plan); + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku associated with this account. + * + * @param sku The sku associated with this account. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of account, if supported. + * + * @param kind The kind of account, if supported. + * @return the next definition stage. + */ + WithCreate withKind(Sku kind); + } + /** The stage of the ObjectAnchorsAccount definition allowing to specify storageAccountName. */ + interface WithStorageAccountName { + /** + * Specifies the storageAccountName property: The name of the storage account associated with this + * accountId. + * + * @param storageAccountName The name of the storage account associated with this accountId. + * @return the next definition stage. + */ + WithCreate withStorageAccountName(String storageAccountName); + } + } + /** + * Begins update for the ObjectAnchorsAccount resource. + * + * @return the stage of resource update. + */ + ObjectAnchorsAccount.Update update(); + + /** The template for ObjectAnchorsAccount update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithPlan, + UpdateStages.WithSku, + UpdateStages.WithKind, + UpdateStages.WithStorageAccountName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ObjectAnchorsAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ObjectAnchorsAccount apply(Context context); + } + /** The ObjectAnchorsAccount update stages. */ + interface UpdateStages { + /** The stage of the ObjectAnchorsAccount 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 ObjectAnchorsAccount update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity property.. + * + * @param identity The identity property. + * @return the next definition stage. + */ + Update withIdentity(ObjectAnchorsAccountIdentity identity); + } + /** The stage of the ObjectAnchorsAccount update allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: The plan associated with this account. + * + * @param plan The plan associated with this account. + * @return the next definition stage. + */ + Update withPlan(Identity plan); + } + /** The stage of the ObjectAnchorsAccount update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku associated with this account. + * + * @param sku The sku associated with this account. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the ObjectAnchorsAccount update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of account, if supported. + * + * @param kind The kind of account, if supported. + * @return the next definition stage. + */ + Update withKind(Sku kind); + } + /** The stage of the ObjectAnchorsAccount update allowing to specify storageAccountName. */ + interface WithStorageAccountName { + /** + * Specifies the storageAccountName property: The name of the storage account associated with this + * accountId. + * + * @param storageAccountName The name of the storage account associated with this accountId. + * @return the next definition stage. + */ + Update withStorageAccountName(String storageAccountName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ObjectAnchorsAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ObjectAnchorsAccount refresh(Context context); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + Response listKeysWithResponse(Context context); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + AccountKeys listKeys(); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param regenerate Required information for key regeneration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + Response regenerateKeysWithResponse(AccountKeyRegenerateRequest regenerate, Context context); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + AccountKeys regenerateKeys(AccountKeyRegenerateRequest regenerate); +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountIdentity.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountIdentity.java new file mode 100644 index 0000000000000..c4a50d62a6a1d --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountIdentity.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.models; + +import com.azure.core.annotation.Fluent; + +/** The ObjectAnchorsAccountIdentity model. */ +@Fluent +public final class ObjectAnchorsAccountIdentity extends Identity { + /** Creates an instance of ObjectAnchorsAccountIdentity class. */ + public ObjectAnchorsAccountIdentity() { + } + + /** {@inheritDoc} */ + @Override + public ObjectAnchorsAccountIdentity withType(ResourceIdentityType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountPage.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountPage.java new file mode 100644 index 0000000000000..2e0d9e72801cb --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccountPage.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.mixedreality.fluent.models.ObjectAnchorsAccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set + * of results. + */ +@Fluent +public final class ObjectAnchorsAccountPage { + /* + * List of resources supported by the Resource Provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of resource list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ObjectAnchorsAccountPage class. */ + public ObjectAnchorsAccountPage() { + } + + /** + * Get the value property: List of resources supported by the Resource Provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources supported by the Resource Provider. + * + * @param value the value value to set. + * @return the ObjectAnchorsAccountPage object itself. + */ + public ObjectAnchorsAccountPage withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of resource list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of resource list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ObjectAnchorsAccountPage object itself. + */ + public ObjectAnchorsAccountPage withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccounts.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccounts.java new file mode 100644 index 0000000000000..ef0737f3c618d --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/ObjectAnchorsAccounts.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.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 ObjectAnchorsAccounts. */ +public interface ObjectAnchorsAccounts { + /** + * List Object Anchors Accounts by Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Object Anchors Accounts by Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to get resource collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Retrieve an Object Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return objectAnchorsAccount Response. + */ + ObjectAnchorsAccount getByResourceGroup(String resourceGroupName, String accountName); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List Both of the 2 Keys of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + AccountKeys listKeys(String resourceGroupName, String accountName); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account along with {@link Response}. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, Context context); + + /** + * Regenerate specified Key of an object anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param regenerate Required information for key regeneration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer Keys of account. + */ + AccountKeys regenerateKeys(String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate); + + /** + * Retrieve an Object Anchors Account. + * + * @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 objectAnchorsAccount Response along with {@link Response}. + */ + ObjectAnchorsAccount getById(String id); + + /** + * Retrieve an Object Anchors Account. + * + * @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 objectAnchorsAccount Response along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an Object Anchors Account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an Object Anchors Account. + * + * @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 ObjectAnchorsAccount resource. + * + * @param name resource name. + * @return the first stage of the new ObjectAnchorsAccount definition. + */ + ObjectAnchorsAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java index 9ea44e3158b2c..78322213428c8 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/models/Serial.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** serial of key to be regenerated. */ +/** Serial of key to be regenerated. */ public enum Serial { /** Enum value 1. */ ONE(1), diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsCreateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsCreateSamples.java new file mode 100644 index 0000000000000..290fc894fa7f2 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; + +/** Samples for ObjectAnchorsAccounts Create. */ +public final class ObjectAnchorsAccountsCreateSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Put.json + */ + /** + * Sample code: Create object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void createObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .define("MyAccount") + .withRegion("eastus2euap") + .withExistingResourceGroup("MyResourceGroup") + .withIdentity(new ObjectAnchorsAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsDeleteSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsDeleteSamples.java new file mode 100644 index 0000000000000..8a5c091274adb --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +/** Samples for ObjectAnchorsAccounts Delete. */ +public final class ObjectAnchorsAccountsDeleteSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Delete.json + */ + /** + * Sample code: Delete object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void deleteObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .deleteByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsGetByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fa83e9fac6685 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +/** Samples for ObjectAnchorsAccounts GetByResourceGroup. */ +public final class ObjectAnchorsAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Get.json + */ + /** + * Sample code: Get object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void getObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..67bf61127ded2 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +/** Samples for ObjectAnchorsAccounts ListByResourceGroup. */ +public final class ObjectAnchorsAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/GetByResourceGroup.json + */ + /** + * Sample code: List object anchors accounts by resource group. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountsByResourceGroup( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager.objectAnchorsAccounts().listByResourceGroup("MyResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListKeysSamples.java new file mode 100644 index 0000000000000..cfc6f1c6cca33 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +/** Samples for ObjectAnchorsAccounts ListKeys. */ +public final class ObjectAnchorsAccountsListKeysSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/ListKeys.json + */ + /** + * Sample code: List object anchors account key. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountKey(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .listKeysWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListSamples.java new file mode 100644 index 0000000000000..3cddc474bb467 --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +/** Samples for ObjectAnchorsAccounts List. */ +public final class ObjectAnchorsAccountsListSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/GetBySubscription.json + */ + /** + * Sample code: List object anchors accounts by subscription. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void listObjectAnchorsAccountsBySubscription( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager.objectAnchorsAccounts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsRegenerateKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsRegenerateKeysSamples.java new file mode 100644 index 0000000000000..5ddfa7d087b6e --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsRegenerateKeysSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; +import com.azure.resourcemanager.mixedreality.models.Serial; + +/** Samples for ObjectAnchorsAccounts RegenerateKeys. */ +public final class ObjectAnchorsAccountsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/RegenerateKey.json + */ + /** + * Sample code: Regenerate object anchors account keys. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void regenerateObjectAnchorsAccountKeys( + com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + manager + .objectAnchorsAccounts() + .regenerateKeysWithResponse( + "MyResourceGroup", + "MyAccount", + new AccountKeyRegenerateRequest().withSerial(Serial.ONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsUpdateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsUpdateSamples.java new file mode 100644 index 0000000000000..d0236a0ad79eb --- /dev/null +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ObjectAnchorsAccountsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mixedreality.generated; + +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccount; +import com.azure.resourcemanager.mixedreality.models.ObjectAnchorsAccountIdentity; +import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ObjectAnchorsAccounts Update. */ +public final class ObjectAnchorsAccountsUpdateSamples { + /* + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/object-anchors/Patch.json + */ + /** + * Sample code: Update object anchors account. + * + * @param manager Entry point to MixedRealityManager. + */ + public static void updateObjectAnchorsAccount(com.azure.resourcemanager.mixedreality.MixedRealityManager manager) { + ObjectAnchorsAccount resource = + manager + .objectAnchorsAccounts() + .getByResourceGroupWithResponse("MyResourceGroup", "MyAccount", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("hero", "romeo", "heroine", "juliet")) + .withIdentity(new ObjectAnchorsAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java index 3617819220ab9..86e6e117675d7 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/ExposingAvailableOperations.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/proxy/ExposingAvailableOperations.json */ /** * Sample code: List available operations. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java index 1307034f142fd..47fd9c7fd233b 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateSamples.java @@ -10,7 +10,7 @@ /** Samples for RemoteRenderingAccounts Create. */ public final class RemoteRenderingAccountsCreateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Put.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Put.json */ /** * Sample code: Create remote rendering account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java index b13dede5c11cc..941a9011e2cff 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for RemoteRenderingAccounts Delete. */ public final class RemoteRenderingAccountsDeleteSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Delete.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Delete.json */ /** * Sample code: Delete remote rendering account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java index 3599e817fac9f..410f9231d092f 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for RemoteRenderingAccounts GetByResourceGroup. */ public final class RemoteRenderingAccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Get.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Get.json */ /** * Sample code: Get remote rendering account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java index 13e1d0caf7700..54594d96948f4 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for RemoteRenderingAccounts ListByResourceGroup. */ public final class RemoteRenderingAccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/GetByResourceGroup.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/GetByResourceGroup.json */ /** * Sample code: List remote rendering accounts by resource group. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java index aaf95c378aa57..9962b61719da5 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for RemoteRenderingAccounts ListKeys. */ public final class RemoteRenderingAccountsListKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/ListKeys.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/ListKeys.json */ /** * Sample code: List remote rendering account key. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java index 38679c67f022c..c4c059bfb7ed5 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListSamples.java @@ -7,7 +7,7 @@ /** Samples for RemoteRenderingAccounts List. */ public final class RemoteRenderingAccountsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/GetBySubscription.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/GetBySubscription.json */ /** * Sample code: List remote rendering accounts by subscription. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java index 5f1ba6127e7ba..0175232e14306 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsRegenerateKeysSamples.java @@ -10,7 +10,7 @@ /** Samples for RemoteRenderingAccounts RegenerateKeys. */ public final class RemoteRenderingAccountsRegenerateKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/RegenerateKey.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/RegenerateKey.json */ /** * Sample code: Regenerate remote rendering account keys. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java index 58319183dcf80..acc4c915eca87 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for RemoteRenderingAccounts Update. */ public final class RemoteRenderingAccountsUpdateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/remote-rendering/Patch.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/remote-rendering/Patch.json */ /** * Sample code: Update remote rendering account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java index a2e186f706bf0..faadf528842d0 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/ResourceProviderCheckNameAvailabilityLocalSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourceProvider CheckNameAvailabilityLocal. */ public final class ResourceProviderCheckNameAvailabilityLocalSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/proxy/CheckNameAvailabilityForLocalUniqueness.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/proxy/CheckNameAvailabilityForLocalUniqueness.json */ /** * Sample code: CheckLocalNameAvailability. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java index b5fe73640daef..e3ac633983255 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts Create. */ public final class SpatialAnchorsAccountsCreateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Put.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Put.json */ /** * Sample code: Create spatial anchor account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java index 7ed72ab1677c5..99fab08bd4bb8 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts Delete. */ public final class SpatialAnchorsAccountsDeleteSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Delete.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Delete.json */ /** * Sample code: Delete spatial anchors account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java index ac32262d572cc..573cc23cdc623 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts GetByResourceGroup. */ public final class SpatialAnchorsAccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Get.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Get.json */ /** * Sample code: Get spatial anchors account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java index 07bf518eac3f0..3eaf71e485ffc 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts ListByResourceGroup. */ public final class SpatialAnchorsAccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/GetByResourceGroup.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/GetByResourceGroup.json */ /** * Sample code: List spatial anchor accounts by resource group. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java index 723a0ce9b0c10..b103d90e6abc5 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts ListKeys. */ public final class SpatialAnchorsAccountsListKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/ListKeys.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/ListKeys.json */ /** * Sample code: List spatial anchor account key. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java index 7c0df3f39a7bc..7071bde0b19ad 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListSamples.java @@ -7,7 +7,7 @@ /** Samples for SpatialAnchorsAccounts List. */ public final class SpatialAnchorsAccountsListSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/GetBySubscription.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/GetBySubscription.json */ /** * Sample code: List spatial anchors accounts by subscription. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java index d829249584b90..e6b61a0ca1b1e 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsRegenerateKeysSamples.java @@ -10,7 +10,7 @@ /** Samples for SpatialAnchorsAccounts RegenerateKeys. */ public final class SpatialAnchorsAccountsRegenerateKeysSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/RegenerateKey.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/RegenerateKey.json */ /** * Sample code: Regenerate spatial anchors account keys. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java index 5d10afb1029c9..6fa8db766a0c4 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/samples/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for SpatialAnchorsAccounts Update. */ public final class SpatialAnchorsAccountsUpdateSamples { /* - * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/stable/2021-01-01/examples/spatial-anchors/Patch.json + * x-ms-original-file: specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2021-03-01-preview/examples/spatial-anchors/Patch.json */ /** * Sample code: Update spatial anchors account. diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.java deleted file mode 100644 index ef8c8cd019d4a..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/AccountKeyRegenerateRequestTests.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.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest; -import com.azure.resourcemanager.mixedreality.models.Serial; -import org.junit.jupiter.api.Assertions; - -public final class AccountKeyRegenerateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountKeyRegenerateRequest model = - BinaryData.fromString("{\"serial\":1}").toObject(AccountKeyRegenerateRequest.class); - Assertions.assertEquals(Serial.ONE, model.serial()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountKeyRegenerateRequest model = new AccountKeyRegenerateRequest().withSerial(Serial.ONE); - model = BinaryData.fromObject(model).toObject(AccountKeyRegenerateRequest.class); - Assertions.assertEquals(Serial.ONE, model.serial()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index cb4c185f4f229..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"txgcpodgmaajr\",\"type\":\"vdjwzrlovm\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("txgcpodgmaajr", model.name()); - Assertions.assertEquals("vdjwzrlovm", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("txgcpodgmaajr").withType("vdjwzrlovm"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("txgcpodgmaajr", model.name()); - Assertions.assertEquals("vdjwzrlovm", model.type()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index 7d178fb159691..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/CheckNameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"j\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, model.reason()); - Assertions.assertEquals("j", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = - new CheckNameAvailabilityResponseInner() - .withNameAvailable(true) - .withReason(NameUnavailableReason.INVALID) - .withMessage("j"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, model.reason()); - Assertions.assertEquals("j", model.message()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java deleted file mode 100644 index 0b5a7f9db1aba..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/IdentityTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"wutttxfvjrbi\",\"tenantId\":\"hxepcyvahfnlj\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java deleted file mode 100644 index 27e0c0b23e4bb..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/LogSpecificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import org.junit.jupiter.api.Assertions; - -public final class LogSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogSpecification model = - BinaryData - .fromString("{\"name\":\"dcuf\",\"displayName\":\"srp\",\"blobDuration\":\"zidnsezcxtbzsgfy\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("dcuf", model.name()); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model = - new LogSpecification().withName("dcuf").withDisplayName("srp").withBlobDuration("zidnsezcxtbzsgfy"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("dcuf", model.name()); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.blobDuration()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java deleted file mode 100644 index 2920dc3635faf..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricDimensionTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import org.junit.jupiter.api.Assertions; - -public final class MetricDimensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricDimension model = - BinaryData - .fromString( - "{\"name\":\"hhbcsglummajtjao\",\"displayName\":\"obnbdxkqpxokaj\",\"internalName\":\"npime\",\"toBeExportedForShoebox\":false}") - .toObject(MetricDimension.class); - Assertions.assertEquals("hhbcsglummajtjao", model.name()); - Assertions.assertEquals("obnbdxkqpxokaj", model.displayName()); - Assertions.assertEquals("npime", model.internalName()); - Assertions.assertEquals(false, model.toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricDimension model = - new MetricDimension() - .withName("hhbcsglummajtjao") - .withDisplayName("obnbdxkqpxokaj") - .withInternalName("npime") - .withToBeExportedForShoebox(false); - model = BinaryData.fromObject(model).toObject(MetricDimension.class); - Assertions.assertEquals("hhbcsglummajtjao", model.name()); - Assertions.assertEquals("obnbdxkqpxokaj", model.displayName()); - Assertions.assertEquals("npime", model.internalName()); - Assertions.assertEquals(false, model.toBeExportedForShoebox()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java deleted file mode 100644 index 2fc4c3ef7ca20..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MetricSpecificationTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.MetricDimension; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricSpecification model = - BinaryData - .fromString( - "{\"name\":\"sne\",\"displayName\":\"dwzjeiach\",\"displayDescription\":\"osfln\",\"unit\":\"sfqpteehz\",\"aggregationType\":\"ypyqrimzinp\",\"supportedAggregationTypes\":[\"jdkirsoodqx\"],\"supportedTimeGrainTypes\":[\"mnoh\",\"t\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"dsoifiyipj\",\"sourceMdmNamespace\":\"qwpgrjbzn\",\"metricFilterPattern\":\"cjxvsnbyxqab\",\"fillGapWithZero\":false,\"category\":\"pcyshu\",\"internalMetricName\":\"afbljjgpbtoqcjmk\",\"dimensions\":[{\"name\":\"bqidtqaj\",\"displayName\":\"ulpkudjkrl\",\"internalName\":\"bzhfepgzgqexz\",\"toBeExportedForShoebox\":false}],\"lockedAggregationType\":\"scpai\"}") - .toObject(MetricSpecification.class); - Assertions.assertEquals("sne", model.name()); - Assertions.assertEquals("dwzjeiach", model.displayName()); - Assertions.assertEquals("osfln", model.displayDescription()); - Assertions.assertEquals("sfqpteehz", model.unit()); - Assertions.assertEquals("ypyqrimzinp", model.aggregationType()); - Assertions.assertEquals("jdkirsoodqx", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("mnoh", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, model.enableRegionalMdmAccount()); - Assertions.assertEquals("dsoifiyipj", model.sourceMdmAccount()); - Assertions.assertEquals("qwpgrjbzn", model.sourceMdmNamespace()); - Assertions.assertEquals("cjxvsnbyxqab", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("pcyshu", model.category()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.internalMetricName()); - Assertions.assertEquals("bqidtqaj", model.dimensions().get(0).name()); - Assertions.assertEquals("ulpkudjkrl", model.dimensions().get(0).displayName()); - Assertions.assertEquals("bzhfepgzgqexz", model.dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("scpai", model.lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecification model = - new MetricSpecification() - .withName("sne") - .withDisplayName("dwzjeiach") - .withDisplayDescription("osfln") - .withUnit("sfqpteehz") - .withAggregationType("ypyqrimzinp") - .withSupportedAggregationTypes(Arrays.asList("jdkirsoodqx")) - .withSupportedTimeGrainTypes(Arrays.asList("mnoh", "t")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("dsoifiyipj") - .withSourceMdmNamespace("qwpgrjbzn") - .withMetricFilterPattern("cjxvsnbyxqab") - .withFillGapWithZero(false) - .withCategory("pcyshu") - .withInternalMetricName("afbljjgpbtoqcjmk") - .withDimensions( - Arrays - .asList( - new MetricDimension() - .withName("bqidtqaj") - .withDisplayName("ulpkudjkrl") - .withInternalName("bzhfepgzgqexz") - .withToBeExportedForShoebox(false))) - .withLockedAggregationType("scpai"); - model = BinaryData.fromObject(model).toObject(MetricSpecification.class); - Assertions.assertEquals("sne", model.name()); - Assertions.assertEquals("dwzjeiach", model.displayName()); - Assertions.assertEquals("osfln", model.displayDescription()); - Assertions.assertEquals("sfqpteehz", model.unit()); - Assertions.assertEquals("ypyqrimzinp", model.aggregationType()); - Assertions.assertEquals("jdkirsoodqx", model.supportedAggregationTypes().get(0)); - Assertions.assertEquals("mnoh", model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(true, model.enableRegionalMdmAccount()); - Assertions.assertEquals("dsoifiyipj", model.sourceMdmAccount()); - Assertions.assertEquals("qwpgrjbzn", model.sourceMdmNamespace()); - Assertions.assertEquals("cjxvsnbyxqab", model.metricFilterPattern()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals("pcyshu", model.category()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.internalMetricName()); - Assertions.assertEquals("bqidtqaj", model.dimensions().get(0).name()); - Assertions.assertEquals("ulpkudjkrl", model.dimensions().get(0).displayName()); - Assertions.assertEquals("bzhfepgzgqexz", model.dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("scpai", model.lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java deleted file mode 100644 index 2d3f20ca2d600..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/MixedRealityAccountPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.MixedRealityAccountProperties; -import org.junit.jupiter.api.Assertions; - -public final class MixedRealityAccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MixedRealityAccountProperties model = - BinaryData - .fromString( - "{\"storageAccountName\":\"ylihkaetckt\",\"accountId\":\"civfsnkymuctq\",\"accountDomain\":\"fbebrjcxer\"}") - .toObject(MixedRealityAccountProperties.class); - Assertions.assertEquals("ylihkaetckt", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MixedRealityAccountProperties model = new MixedRealityAccountProperties().withStorageAccountName("ylihkaetckt"); - model = BinaryData.fromObject(model).toObject(MixedRealityAccountProperties.class); - Assertions.assertEquals("ylihkaetckt", model.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java deleted file mode 100644 index 90fbabdec3394..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrlhmwhfpmrqobm\",\"resource\":\"u\",\"operation\":\"knryrtihfxtij\",\"description\":\"pzvgnwzsymglzufc\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("knryrtihfxtij", model.operation()); - Assertions.assertEquals("pzvgnwzsymglzufc", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("yrlhmwhfpmrqobm") - .withResource("u") - .withOperation("knryrtihfxtij") - .withDescription("pzvgnwzsymglzufc"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.provider()); - Assertions.assertEquals("u", model.resource()); - Assertions.assertEquals("knryrtihfxtij", model.operation()); - Assertions.assertEquals("pzvgnwzsymglzufc", model.description()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java deleted file mode 100644 index 8a4ec30929c33..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationInnerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"itjz\",\"display\":{\"provider\":\"lusarh\",\"resource\":\"ofcqhsm\",\"operation\":\"urkdtmlx\",\"description\":\"ekuksjtx\"},\"isDataAction\":false,\"origin\":\"mparcryuanzw\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[],\"metricSpecifications\":[]}}}") - .toObject(OperationInner.class); - Assertions.assertEquals("itjz", model.name()); - Assertions.assertEquals("lusarh", model.display().provider()); - Assertions.assertEquals("ofcqhsm", model.display().resource()); - Assertions.assertEquals("urkdtmlx", model.display().operation()); - Assertions.assertEquals("ekuksjtx", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("mparcryuanzw", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = - new OperationInner() - .withName("itjz") - .withDisplay( - new OperationDisplay() - .withProvider("lusarh") - .withResource("ofcqhsm") - .withOperation("urkdtmlx") - .withDescription("ekuksjtx")) - .withIsDataAction(false) - .withOrigin("mparcryuanzw") - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications(Arrays.asList()) - .withMetricSpecifications(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("itjz", model.name()); - Assertions.assertEquals("lusarh", model.display().provider()); - Assertions.assertEquals("ofcqhsm", model.display().resource()); - Assertions.assertEquals("urkdtmlx", model.display().operation()); - Assertions.assertEquals("ekuksjtx", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("mparcryuanzw", model.origin()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java deleted file mode 100644 index 35f05ec7c6a23..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPageTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.OperationInner; -import com.azure.resourcemanager.mixedreality.models.OperationDisplay; -import com.azure.resourcemanager.mixedreality.models.OperationPage; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationPage model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"tzopbsphrupidgsy\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"bhdxbm\",\"description\":\"qioqjzehtbmu\"},\"isDataAction\":false,\"origin\":\"noi\",\"properties\":{}},{\"name\":\"rxybqsoq\",\"display\":{\"provider\":\"gkdmb\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qqjnqgl\",\"description\":\"qgn\"},\"isDataAction\":true,\"origin\":\"ojywifsqesa\",\"properties\":{}},{\"name\":\"mglzlhj\",\"display\":{\"provider\":\"ifkwmrvktsizntoc\",\"resource\":\"pa\",\"operation\":\"uajpsquc\",\"description\":\"poyfdkfogkn\"},\"isDataAction\":false,\"origin\":\"fjddeqs\",\"properties\":{}}],\"nextLink\":\"pewnw\"}") - .toObject(OperationPage.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("bhdxbm", model.value().get(0).display().operation()); - Assertions.assertEquals("qioqjzehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("noi", model.value().get(0).origin()); - Assertions.assertEquals("pewnw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationPage model = - new OperationPage() - .withValue( - Arrays - .asList( - new OperationInner() - .withName("quvgjxpybczme") - .withDisplay( - new OperationDisplay() - .withProvider("tzopbsphrupidgsy") - .withResource("bejhphoycmsxa") - .withOperation("bhdxbm") - .withDescription("qioqjzehtbmu")) - .withIsDataAction(false) - .withOrigin("noi") - .withProperties(new OperationProperties()), - new OperationInner() - .withName("rxybqsoq") - .withDisplay( - new OperationDisplay() - .withProvider("gkdmb") - .withResource("azlobcufpdznrbt") - .withOperation("qqjnqgl") - .withDescription("qgn")) - .withIsDataAction(true) - .withOrigin("ojywifsqesa") - .withProperties(new OperationProperties()), - new OperationInner() - .withName("mglzlhj") - .withDisplay( - new OperationDisplay() - .withProvider("ifkwmrvktsizntoc") - .withResource("pa") - .withOperation("uajpsquc") - .withDescription("poyfdkfogkn")) - .withIsDataAction(false) - .withOrigin("fjddeqs") - .withProperties(new OperationProperties()))) - .withNextLink("pewnw"); - model = BinaryData.fromObject(model).toObject(OperationPage.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("bhdxbm", model.value().get(0).display().operation()); - Assertions.assertEquals("qioqjzehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("noi", model.value().get(0).origin()); - Assertions.assertEquals("pewnw", model.nextLink()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java deleted file mode 100644 index 7390bb4b1bd92..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.OperationProperties; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = - BinaryData - .fromString( - "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"dbihanufhfcbj\",\"displayName\":\"a\",\"blobDuration\":\"th\"},{\"name\":\"hab\",\"displayName\":\"pikxwczbyscnpqxu\",\"blobDuration\":\"vyq\"},{\"name\":\"wby\",\"displayName\":\"k\",\"blobDuration\":\"dumjgrtfwvuk\"}],\"metricSpecifications\":[{\"name\":\"dcc\",\"displayName\":\"h\",\"displayDescription\":\"cnyejhkryhtnapcz\",\"unit\":\"okjye\",\"aggregationType\":\"kvnipjoxz\",\"supportedAggregationTypes\":[],\"supportedTimeGrainTypes\":[],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"jspodmailzyde\",\"sourceMdmNamespace\":\"jwyahuxinpmqnja\",\"metricFilterPattern\":\"ixjsprozvcputeg\",\"fillGapWithZero\":true,\"category\":\"fdatsc\",\"internalMetricName\":\"vpjhulsuuv\",\"dimensions\":[],\"lockedAggregationType\":\"ozkrwfndiodjpslw\"},{\"name\":\"dpvwryoqpsoaccta\",\"displayName\":\"kljla\",\"displayDescription\":\"cr\",\"unit\":\"fdfdosygexpa\",\"aggregationType\":\"akhmsbzjhcrz\",\"supportedAggregationTypes\":[],\"supportedTimeGrainTypes\":[],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"xaolth\",\"sourceMdmNamespace\":\"rgqjbpfzfsinzg\",\"metricFilterPattern\":\"cjrwzoxxjtfellu\",\"fillGapWithZero\":true,\"category\":\"tonpe\",\"internalMetricName\":\"pjkjlxofpdv\",\"dimensions\":[],\"lockedAggregationType\":\"xxypininmay\"},{\"name\":\"ybb\",\"displayName\":\"odepoogin\",\"displayDescription\":\"amiheognarxz\",\"unit\":\"heotusiv\",\"aggregationType\":\"v\",\"supportedAggregationTypes\":[],\"supportedTimeGrainTypes\":[],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"nhungbw\",\"sourceMdmNamespace\":\"rnfygxgispem\",\"metricFilterPattern\":\"zfkufubljofx\",\"fillGapWithZero\":true,\"category\":\"jaeq\",\"internalMetricName\":\"qjbasvms\",\"dimensions\":[],\"lockedAggregationType\":\"ulngsntn\"}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("dbihanufhfcbj", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("a", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dcc", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("h", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "cnyejhkryhtnapcz", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("okjye", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions - .assertEquals("kvnipjoxz", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions - .assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions - .assertEquals( - "jspodmailzyde", model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions - .assertEquals( - "jwyahuxinpmqnja", model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions - .assertEquals( - "ixjsprozvcputeg", model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("fdatsc", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions - .assertEquals( - "vpjhulsuuv", model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions - .assertEquals( - "ozkrwfndiodjpslw", model.serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification() - .withName("dbihanufhfcbj") - .withDisplayName("a") - .withBlobDuration("th"), - new LogSpecification() - .withName("hab") - .withDisplayName("pikxwczbyscnpqxu") - .withBlobDuration("vyq"), - new LogSpecification() - .withName("wby") - .withDisplayName("k") - .withBlobDuration("dumjgrtfwvuk"))) - .withMetricSpecifications( - Arrays - .asList( - new MetricSpecification() - .withName("dcc") - .withDisplayName("h") - .withDisplayDescription("cnyejhkryhtnapcz") - .withUnit("okjye") - .withAggregationType("kvnipjoxz") - .withSupportedAggregationTypes(Arrays.asList()) - .withSupportedTimeGrainTypes(Arrays.asList()) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("jspodmailzyde") - .withSourceMdmNamespace("jwyahuxinpmqnja") - .withMetricFilterPattern("ixjsprozvcputeg") - .withFillGapWithZero(true) - .withCategory("fdatsc") - .withInternalMetricName("vpjhulsuuv") - .withDimensions(Arrays.asList()) - .withLockedAggregationType("ozkrwfndiodjpslw"), - new MetricSpecification() - .withName("dpvwryoqpsoaccta") - .withDisplayName("kljla") - .withDisplayDescription("cr") - .withUnit("fdfdosygexpa") - .withAggregationType("akhmsbzjhcrz") - .withSupportedAggregationTypes(Arrays.asList()) - .withSupportedTimeGrainTypes(Arrays.asList()) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("xaolth") - .withSourceMdmNamespace("rgqjbpfzfsinzg") - .withMetricFilterPattern("cjrwzoxxjtfellu") - .withFillGapWithZero(true) - .withCategory("tonpe") - .withInternalMetricName("pjkjlxofpdv") - .withDimensions(Arrays.asList()) - .withLockedAggregationType("xxypininmay"), - new MetricSpecification() - .withName("ybb") - .withDisplayName("odepoogin") - .withDisplayDescription("amiheognarxz") - .withUnit("heotusiv") - .withAggregationType("v") - .withSupportedAggregationTypes(Arrays.asList()) - .withSupportedTimeGrainTypes(Arrays.asList()) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("nhungbw") - .withSourceMdmNamespace("rnfygxgispem") - .withMetricFilterPattern("zfkufubljofx") - .withFillGapWithZero(true) - .withCategory("jaeq") - .withInternalMetricName("qjbasvms") - .withDimensions(Arrays.asList()) - .withLockedAggregationType("ulngsntn")))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("dbihanufhfcbj", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("a", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dcc", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("h", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "cnyejhkryhtnapcz", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("okjye", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions - .assertEquals("kvnipjoxz", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions - .assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions - .assertEquals( - "jspodmailzyde", model.serviceSpecification().metricSpecifications().get(0).sourceMdmAccount()); - Assertions - .assertEquals( - "jwyahuxinpmqnja", model.serviceSpecification().metricSpecifications().get(0).sourceMdmNamespace()); - Assertions - .assertEquals( - "ixjsprozvcputeg", model.serviceSpecification().metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("fdatsc", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions - .assertEquals( - "vpjhulsuuv", model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions - .assertEquals( - "ozkrwfndiodjpslw", model.serviceSpecification().metricSpecifications().get(0).lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java deleted file mode 100644 index 5773cbda11786..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/OperationsListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"nr\",\"display\":{\"provider\":\"folhbnxknal\",\"resource\":\"ulppggdtpnapnyir\",\"operation\":\"pu\",\"description\":\"pigvpgylgqgitx\"},\"isDataAction\":false,\"origin\":\"v\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[],\"metricSpecifications\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nr", response.iterator().next().name()); - Assertions.assertEquals("folhbnxknal", response.iterator().next().display().provider()); - Assertions.assertEquals("ulppggdtpnapnyir", response.iterator().next().display().resource()); - Assertions.assertEquals("pu", response.iterator().next().display().operation()); - Assertions.assertEquals("pigvpgylgqgitx", response.iterator().next().display().description()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("v", response.iterator().next().origin()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java deleted file mode 100644 index 1fa3b8a07b60b..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountInnerTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RemoteRenderingAccountInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteRenderingAccountInner model = - BinaryData - .fromString( - "{\"properties\":{\"storageAccountName\":\"cqibycnojv\",\"accountId\":\"mefqsgzvahapjyzh\",\"accountDomain\":\"gqzcjr\"},\"identity\":{\"principalId\":\"jzlmw\",\"tenantId\":\"kvugfhzovawjvzun\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"n\",\"tenantId\":\"nxipeil\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"aejxd\",\"tier\":\"Premium\",\"size\":\"kzbbtd\",\"family\":\"mv\",\"capacity\":1487921664},\"kind\":{\"name\":\"pwo\",\"tier\":\"Basic\",\"size\":\"fpbsjyofdxl\",\"family\":\"sd\",\"capacity\":1422945070},\"location\":\"waboe\",\"tags\":{\"hhcaal\":\"kelnsmvbxwyjsf\"},\"id\":\"jixisxyawjoyaqcs\",\"name\":\"yjpkiidzyexz\",\"type\":\"eli\"}") - .toObject(RemoteRenderingAccountInner.class); - Assertions.assertEquals("waboe", model.location()); - Assertions.assertEquals("kelnsmvbxwyjsf", model.tags().get("hhcaal")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("aejxd", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("kzbbtd", model.sku().size()); - Assertions.assertEquals("mv", model.sku().family()); - Assertions.assertEquals(1487921664, model.sku().capacity()); - Assertions.assertEquals("pwo", model.kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.kind().tier()); - Assertions.assertEquals("fpbsjyofdxl", model.kind().size()); - Assertions.assertEquals("sd", model.kind().family()); - Assertions.assertEquals(1422945070, model.kind().capacity()); - Assertions.assertEquals("cqibycnojv", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteRenderingAccountInner model = - new RemoteRenderingAccountInner() - .withLocation("waboe") - .withTags(mapOf("hhcaal", "kelnsmvbxwyjsf")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("aejxd") - .withTier(SkuTier.PREMIUM) - .withSize("kzbbtd") - .withFamily("mv") - .withCapacity(1487921664)) - .withKind( - new Sku() - .withName("pwo") - .withTier(SkuTier.BASIC) - .withSize("fpbsjyofdxl") - .withFamily("sd") - .withCapacity(1422945070)) - .withStorageAccountName("cqibycnojv"); - model = BinaryData.fromObject(model).toObject(RemoteRenderingAccountInner.class); - Assertions.assertEquals("waboe", model.location()); - Assertions.assertEquals("kelnsmvbxwyjsf", model.tags().get("hhcaal")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("aejxd", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("kzbbtd", model.sku().size()); - Assertions.assertEquals("mv", model.sku().family()); - Assertions.assertEquals(1487921664, model.sku().capacity()); - Assertions.assertEquals("pwo", model.kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.kind().tier()); - Assertions.assertEquals("fpbsjyofdxl", model.kind().size()); - Assertions.assertEquals("sd", model.kind().family()); - Assertions.assertEquals(1422945070, model.kind().capacity()); - Assertions.assertEquals("cqibycnojv", model.storageAccountName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int 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/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java deleted file mode 100644 index 7d27cf7e02db0..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountPageTests.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccountPage; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RemoteRenderingAccountPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemoteRenderingAccountPage model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"storageAccountName\":\"debfqkkrbmpukgri\",\"accountId\":\"lzlfbxzpuz\",\"accountDomain\":\"ispnqzahmgkbrp\"},\"identity\":{\"principalId\":\"hibnuqqkpika\",\"tenantId\":\"gvtqagnbuynh\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"ebf\",\"tenantId\":\"arbu\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"pnazzm\",\"tier\":\"Basic\",\"size\":\"nmpxttdb\",\"family\":\"bnlankxmyskpb\",\"capacity\":1074926668},\"kind\":{\"name\":\"tkcxywnytnrsy\",\"tier\":\"Basic\",\"size\":\"dybyxczfclhaa\",\"family\":\"babphlwrqlfk\",\"capacity\":1003967781},\"location\":\"sucocmnyyazttbtw\",\"tags\":{\"yueaxibxujwb\":\"puedckzywbiexzf\",\"zjancuxr\":\"qwalmuzyoxaepd\",\"bavxbniwdjswzt\":\"d\",\"xbzpfzab\":\"dbpgnxytxhp\"},\"id\":\"lcuhxwtctyqiklb\",\"name\":\"ovplw\",\"type\":\"bhvgy\"},{\"properties\":{\"storageAccountName\":\"osvmk\",\"accountId\":\"sxqu\",\"accountDomain\":\"fpl\"},\"identity\":{\"principalId\":\"sxnkjzkdeslpvlo\",\"tenantId\":\"i\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"pkdwzbai\",\"tenantId\":\"bbaumnyquped\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"a\",\"tier\":\"Standard\",\"size\":\"smtxpsieb\",\"family\":\"hvpesapskrdqm\",\"capacity\":1058725142},\"kind\":{\"name\":\"htldwk\",\"tier\":\"Premium\",\"size\":\"utknc\",\"family\":\"cwsvlxotog\",\"capacity\":918188408},\"location\":\"pqsxvnmicy\",\"tags\":{\"fcnj\":\"eoveilovnotyf\",\"nxdhbt\":\"k\",\"nermcl\":\"kphywpnvjto\"},\"id\":\"plpho\",\"name\":\"uscrpabgyepsb\",\"type\":\"tazqugxywpmueefj\"},{\"properties\":{\"storageAccountName\":\"qkqujidsu\",\"accountId\":\"nobglaocq\",\"accountDomain\":\"ccm\"},\"identity\":{\"principalId\":\"dxyt\",\"tenantId\":\"oyrxvwfudwpzntxh\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"qj\",\"tenantId\":\"ck\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"rxsbkyvp\",\"tier\":\"Premium\",\"size\":\"uzbpzkafku\",\"family\":\"crnwbmeh\",\"capacity\":2008133985},\"kind\":{\"name\":\"v\",\"tier\":\"Premium\",\"size\":\"tslhspkdeem\",\"family\":\"fm\",\"capacity\":1437529213},\"location\":\"vt\",\"tags\":{\"c\":\"mqkrhahvljuahaqu\",\"aex\":\"hmdua\",\"vxpvgomz\":\"pvfadmwsrcr\"},\"id\":\"fmisg\",\"name\":\"bnbbeldawkz\",\"type\":\"ali\"},{\"properties\":{\"storageAccountName\":\"qhakauhashsf\",\"accountId\":\"osow\",\"accountDomain\":\"cugicjoox\"},\"identity\":{\"principalId\":\"bwpucwwfvovbv\",\"tenantId\":\"uecivyhz\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"gjrwjueiotwmcdyt\",\"tenantId\":\"wit\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"awgqwgxhni\",\"tier\":\"Free\",\"size\":\"bkpyc\",\"family\":\"lwn\",\"capacity\":1035502887},\"kind\":{\"name\":\"dauwhvylwzbtd\",\"tier\":\"Basic\",\"size\":\"znbmpowuwprzq\",\"family\":\"eualupjmkhf\",\"capacity\":768618296},\"location\":\"cswsrtjri\",\"tags\":{\"c\":\"bpbewtghfgb\",\"gibtnm\":\"wxzvlvqhjkb\",\"j\":\"iebwwaloayqcgwrt\",\"yzm\":\"zg\"},\"id\":\"txon\",\"name\":\"mtsavjcbpwxqp\",\"type\":\"rknftguvriuhprwm\"}],\"nextLink\":\"vxqtayriwwroyqbe\"}") - .toObject(RemoteRenderingAccountPage.class); - Assertions.assertEquals("sucocmnyyazttbtw", model.value().get(0).location()); - Assertions.assertEquals("puedckzywbiexzf", model.value().get(0).tags().get("yueaxibxujwb")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("pnazzm", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("nmpxttdb", model.value().get(0).sku().size()); - Assertions.assertEquals("bnlankxmyskpb", model.value().get(0).sku().family()); - Assertions.assertEquals(1074926668, model.value().get(0).sku().capacity()); - Assertions.assertEquals("tkcxywnytnrsy", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("dybyxczfclhaa", model.value().get(0).kind().size()); - Assertions.assertEquals("babphlwrqlfk", model.value().get(0).kind().family()); - Assertions.assertEquals(1003967781, model.value().get(0).kind().capacity()); - Assertions.assertEquals("debfqkkrbmpukgri", model.value().get(0).storageAccountName()); - Assertions.assertEquals("vxqtayriwwroyqbe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemoteRenderingAccountPage model = - new RemoteRenderingAccountPage() - .withValue( - Arrays - .asList( - new RemoteRenderingAccountInner() - .withLocation("sucocmnyyazttbtw") - .withTags( - mapOf( - "yueaxibxujwb", - "puedckzywbiexzf", - "zjancuxr", - "qwalmuzyoxaepd", - "bavxbniwdjswzt", - "d", - "xbzpfzab", - "dbpgnxytxhp")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("pnazzm") - .withTier(SkuTier.BASIC) - .withSize("nmpxttdb") - .withFamily("bnlankxmyskpb") - .withCapacity(1074926668)) - .withKind( - new Sku() - .withName("tkcxywnytnrsy") - .withTier(SkuTier.BASIC) - .withSize("dybyxczfclhaa") - .withFamily("babphlwrqlfk") - .withCapacity(1003967781)) - .withStorageAccountName("debfqkkrbmpukgri"), - new RemoteRenderingAccountInner() - .withLocation("pqsxvnmicy") - .withTags(mapOf("fcnj", "eoveilovnotyf", "nxdhbt", "k", "nermcl", "kphywpnvjto")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("a") - .withTier(SkuTier.STANDARD) - .withSize("smtxpsieb") - .withFamily("hvpesapskrdqm") - .withCapacity(1058725142)) - .withKind( - new Sku() - .withName("htldwk") - .withTier(SkuTier.PREMIUM) - .withSize("utknc") - .withFamily("cwsvlxotog") - .withCapacity(918188408)) - .withStorageAccountName("osvmk"), - new RemoteRenderingAccountInner() - .withLocation("vt") - .withTags(mapOf("c", "mqkrhahvljuahaqu", "aex", "hmdua", "vxpvgomz", "pvfadmwsrcr")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("rxsbkyvp") - .withTier(SkuTier.PREMIUM) - .withSize("uzbpzkafku") - .withFamily("crnwbmeh") - .withCapacity(2008133985)) - .withKind( - new Sku() - .withName("v") - .withTier(SkuTier.PREMIUM) - .withSize("tslhspkdeem") - .withFamily("fm") - .withCapacity(1437529213)) - .withStorageAccountName("qkqujidsu"), - new RemoteRenderingAccountInner() - .withLocation("cswsrtjri") - .withTags( - mapOf( - "c", - "bpbewtghfgb", - "gibtnm", - "wxzvlvqhjkb", - "j", - "iebwwaloayqcgwrt", - "yzm", - "zg")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("awgqwgxhni") - .withTier(SkuTier.FREE) - .withSize("bkpyc") - .withFamily("lwn") - .withCapacity(1035502887)) - .withKind( - new Sku() - .withName("dauwhvylwzbtd") - .withTier(SkuTier.BASIC) - .withSize("znbmpowuwprzq") - .withFamily("eualupjmkhf") - .withCapacity(768618296)) - .withStorageAccountName("qhakauhashsf"))) - .withNextLink("vxqtayriwwroyqbe"); - model = BinaryData.fromObject(model).toObject(RemoteRenderingAccountPage.class); - Assertions.assertEquals("sucocmnyyazttbtw", model.value().get(0).location()); - Assertions.assertEquals("puedckzywbiexzf", model.value().get(0).tags().get("yueaxibxujwb")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("pnazzm", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("nmpxttdb", model.value().get(0).sku().size()); - Assertions.assertEquals("bnlankxmyskpb", model.value().get(0).sku().family()); - Assertions.assertEquals(1074926668, model.value().get(0).sku().capacity()); - Assertions.assertEquals("tkcxywnytnrsy", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("dybyxczfclhaa", model.value().get(0).kind().size()); - Assertions.assertEquals("babphlwrqlfk", model.value().get(0).kind().family()); - Assertions.assertEquals(1003967781, model.value().get(0).kind().capacity()); - Assertions.assertEquals("debfqkkrbmpukgri", model.value().get(0).storageAccountName()); - Assertions.assertEquals("vxqtayriwwroyqbe", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java deleted file mode 100644 index e293bc616c202..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsCreateWithResponseMockTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"storageAccountName\":\"uetae\",\"accountId\":\"ruvdmov\",\"accountDomain\":\"zlxwabmqoefkifr\"},\"identity\":{\"principalId\":\"u\",\"tenantId\":\"jmqlgkfb\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"ongbjcnt\",\"tenantId\":\"i\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"df\",\"tier\":\"Standard\",\"size\":\"ezkojvdcp\",\"family\":\"oqouicybxarzgszu\",\"capacity\":37759464},\"kind\":{\"name\":\"iqopidoamciod\",\"tier\":\"Free\",\"size\":\"zxkhnzbonlwnto\",\"family\":\"okdwb\",\"capacity\":1161774579},\"location\":\"z\",\"tags\":{\"qgsfraoyzkoow\":\"rvexztvb\"},\"id\":\"lmnguxaw\",\"name\":\"aldsy\",\"type\":\"uximerqfobw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RemoteRenderingAccount response = - manager - .remoteRenderingAccounts() - .define("jnsjervtiagxsd") - .withRegion("vcofudfl") - .withExistingResourceGroup("pulpqblylsyxk") - .withTags(mapOf("dknnqvsazn", "jub")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("qztpp") - .withTier(SkuTier.FREE) - .withSize("xorjaltolmncwsob") - .withFamily("csdbnwdcfhuc") - .withCapacity(895561091)) - .withKind( - new Sku() - .withName("uvglsbjjcanvx") - .withTier(SkuTier.FREE) - .withSize("udutnco") - .withFamily("r") - .withCapacity(1360670450)) - .withStorageAccountName("e") - .create(); - - Assertions.assertEquals("z", response.location()); - Assertions.assertEquals("rvexztvb", response.tags().get("qgsfraoyzkoow")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("df", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("ezkojvdcp", response.sku().size()); - Assertions.assertEquals("oqouicybxarzgszu", response.sku().family()); - Assertions.assertEquals(37759464, response.sku().capacity()); - Assertions.assertEquals("iqopidoamciod", response.kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.kind().tier()); - Assertions.assertEquals("zxkhnzbonlwnto", response.kind().size()); - Assertions.assertEquals("okdwb", response.kind().family()); - Assertions.assertEquals(1161774579, response.kind().capacity()); - Assertions.assertEquals("uetae", response.storageAccountName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int 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/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ec886c51f658e..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .remoteRenderingAccounts() - .deleteByResourceGroupWithResponse("ekkezzikhlyfjh", "gqggebdunygae", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 1c53083b431ae..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"storageAccountName\":\"varmywdmj\",\"accountId\":\"q\",\"accountDomain\":\"hhyxxrw\"},\"identity\":{\"principalId\":\"oduhp\",\"tenantId\":\"kgymareqnajxqug\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"ubeddg\",\"tenantId\":\"ofwq\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"lkrm\",\"tier\":\"Free\",\"size\":\"pxacqqudfn\",\"family\":\"xbaaabjyv\",\"capacity\":2087674757},\"kind\":{\"name\":\"imrzrtuzqog\",\"tier\":\"Standard\",\"size\":\"evfdnwnwm\",\"family\":\"zsyyceuzso\",\"capacity\":2025880638},\"location\":\"dpfrxtrthzvaytdw\",\"tags\":{\"vpdtiirqtdqoa\":\"rqubpaxhexiil\",\"eptra\":\"oruzfgsquyfxrxx\"},\"id\":\"xje\",\"name\":\"wlwnwxuqlcv\",\"type\":\"dy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RemoteRenderingAccount response = - manager - .remoteRenderingAccounts() - .getByResourceGroupWithResponse("idb", "fatpxllrxcyjmoa", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dpfrxtrthzvaytdw", response.location()); - Assertions.assertEquals("rqubpaxhexiil", response.tags().get("vpdtiirqtdqoa")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("lkrm", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("pxacqqudfn", response.sku().size()); - Assertions.assertEquals("xbaaabjyv", response.sku().family()); - Assertions.assertEquals(2087674757, response.sku().capacity()); - Assertions.assertEquals("imrzrtuzqog", response.kind().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.kind().tier()); - Assertions.assertEquals("evfdnwnwm", response.kind().size()); - Assertions.assertEquals("zsyyceuzso", response.kind().family()); - Assertions.assertEquals(2025880638, response.kind().capacity()); - Assertions.assertEquals("varmywdmj", response.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java deleted file mode 100644 index 4829d45e972cb..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"storageAccountName\":\"vvcnayr\",\"accountId\":\"rnxxmueed\",\"accountDomain\":\"rdvstkwqqtch\"},\"identity\":{\"principalId\":\"mfmtdaaygdvw\",\"tenantId\":\"piohgwxrtfu\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"gyqagvrvmnpkuk\",\"tenantId\":\"i\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"xgwim\",\"tier\":\"Basic\",\"size\":\"fjxwmsz\",\"family\":\"foqreyfkzik\",\"capacity\":498356163},\"kind\":{\"name\":\"n\",\"tier\":\"Free\",\"size\":\"xwczelpcire\",\"family\":\"feaenwab\",\"capacity\":737595664},\"location\":\"lddxbjhwua\",\"tags\":{\"youlp\":\"zjosp\"},\"id\":\"rvxaglrvimjwosy\",\"name\":\"xitc\",\"type\":\"kfcktqum\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.remoteRenderingAccounts().listByResourceGroup("z", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lddxbjhwua", response.iterator().next().location()); - Assertions.assertEquals("zjosp", response.iterator().next().tags().get("youlp")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("xgwim", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("fjxwmsz", response.iterator().next().sku().size()); - Assertions.assertEquals("foqreyfkzik", response.iterator().next().sku().family()); - Assertions.assertEquals(498356163, response.iterator().next().sku().capacity()); - Assertions.assertEquals("n", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().kind().tier()); - Assertions.assertEquals("xwczelpcire", response.iterator().next().kind().size()); - Assertions.assertEquals("feaenwab", response.iterator().next().kind().family()); - Assertions.assertEquals(737595664, response.iterator().next().kind().capacity()); - Assertions.assertEquals("vvcnayr", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java deleted file mode 100644 index b16b1182ec6ca..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/RemoteRenderingAccountsListMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccount; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RemoteRenderingAccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"storageAccountName\":\"iipfpubj\",\"accountId\":\"wwiftohqkvpuv\",\"accountDomain\":\"gplsaknynf\"},\"identity\":{\"principalId\":\"ljphuopxodl\",\"tenantId\":\"ynt\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"leosjswsrms\",\"tenantId\":\"zrpzb\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"qqzqioxiysuiizyn\",\"tier\":\"Free\",\"size\":\"atrwyhqmibzyh\",\"family\":\"tsmypyynpcdp\",\"capacity\":874382237},\"kind\":{\"name\":\"g\",\"tier\":\"Free\",\"size\":\"mabiknsorgjhxb\",\"family\":\"tlwwrlk\",\"capacity\":1940246801},\"location\":\"cvokotllxdyhg\",\"tags\":{\"hadoocrk\":\"cogjltdtbn\",\"amqgxqquezikyw\":\"cikhnv\"},\"id\":\"gxk\",\"name\":\"lla\",\"type\":\"melwuipiccjz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.remoteRenderingAccounts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cvokotllxdyhg", response.iterator().next().location()); - Assertions.assertEquals("cogjltdtbn", response.iterator().next().tags().get("hadoocrk")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("qqzqioxiysuiizyn", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals("atrwyhqmibzyh", response.iterator().next().sku().size()); - Assertions.assertEquals("tsmypyynpcdp", response.iterator().next().sku().family()); - Assertions.assertEquals(874382237, response.iterator().next().sku().capacity()); - Assertions.assertEquals("g", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().kind().tier()); - Assertions.assertEquals("mabiknsorgjhxb", response.iterator().next().kind().size()); - Assertions.assertEquals("tlwwrlk", response.iterator().next().kind().family()); - Assertions.assertEquals(1940246801, response.iterator().next().kind().capacity()); - Assertions.assertEquals("iipfpubj", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java deleted file mode 100644 index a057d25ff3484..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.mixedreality.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.mixedreality.models.NameUnavailableReason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckNameAvailabilityLocalWithResponseMockTests { - @Test - public void testCheckNameAvailabilityLocalWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"tfdygpfqb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = - manager - .resourceProviders() - .checkNameAvailabilityLocalWithResponse( - "qwwncw", - new CheckNameAvailabilityRequest().withName("zhxgktrmgucn").withType("pkteo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(NameUnavailableReason.INVALID, response.reason()); - Assertions.assertEquals("tfdygpfqb", response.message()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java deleted file mode 100644 index 59c62007bc1e1..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.LogSpecification; -import com.azure.resourcemanager.mixedreality.models.MetricSpecification; -import com.azure.resourcemanager.mixedreality.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = - BinaryData - .fromString( - "{\"logSpecifications\":[{\"name\":\"zgcwrw\",\"displayName\":\"xxwr\",\"blobDuration\":\"douskcqvkocrcjdk\"},{\"name\":\"nh\",\"displayName\":\"njbiksqrglssain\",\"blobDuration\":\"jwnzlljfmp\"},{\"name\":\"ebvmgxsabkyqd\",\"displayName\":\"jitcjczdzevn\",\"blobDuration\":\"krwpdap\"}],\"metricSpecifications\":[{\"name\":\"dkvwrwjfe\",\"displayName\":\"nhutjeltmrldhugj\",\"displayDescription\":\"datqxhocdgeabl\",\"unit\":\"huticndvkao\",\"aggregationType\":\"yiftyhxhuro\",\"supportedAggregationTypes\":[\"yxolniwp\",\"cukjf\",\"giawx\"],\"supportedTimeGrainTypes\":[\"ypl\",\"ckbasyypndd\",\"sgcbac\",\"hejkotynqgou\"],\"enableRegionalMdmAccount\":false,\"sourceMdmAccount\":\"likwyqkgfgib\",\"sourceMdmNamespace\":\"dgak\",\"metricFilterPattern\":\"s\",\"fillGapWithZero\":false,\"category\":\"zqqedq\",\"internalMetricName\":\"bciqfouflm\",\"dimensions\":[],\"lockedAggregationType\":\"smodmgloug\"},{\"name\":\"kwtmutduqktapspw\",\"displayName\":\"uertumk\",\"displayDescription\":\"svqwhbmdgbbjfd\",\"unit\":\"mbmbexppbh\",\"aggregationType\":\"qrolfpf\",\"supportedAggregationTypes\":[\"lgbquxig\",\"yjgzjaoyfhrtxiln\",\"rkujy\",\"vlejuvfqa\"],\"supportedTimeGrainTypes\":[\"yxwjkcp\",\"bnwbxgjvtbvpyssz\",\"nruj\",\"guhmuouqfpr\"],\"enableRegionalMdmAccount\":true,\"sourceMdmAccount\":\"nguitnwuizgazxu\",\"sourceMdmNamespace\":\"zuckyfi\",\"metricFilterPattern\":\"fidfvzw\",\"fillGapWithZero\":false,\"category\":\"tymw\",\"internalMetricName\":\"dkfthwxmnt\",\"dimensions\":[],\"lockedAggregationType\":\"opvkmijcm\"}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("zgcwrw", model.logSpecifications().get(0).name()); - Assertions.assertEquals("xxwr", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("douskcqvkocrcjdk", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dkvwrwjfe", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("nhutjeltmrldhugj", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("datqxhocdgeabl", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("huticndvkao", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("yiftyhxhuro", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("yxolniwp", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("ypl", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("likwyqkgfgib", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("dgak", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("s", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("zqqedq", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("bciqfouflm", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("smodmgloug", model.metricSpecifications().get(0).lockedAggregationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification() - .withName("zgcwrw") - .withDisplayName("xxwr") - .withBlobDuration("douskcqvkocrcjdk"), - new LogSpecification() - .withName("nh") - .withDisplayName("njbiksqrglssain") - .withBlobDuration("jwnzlljfmp"), - new LogSpecification() - .withName("ebvmgxsabkyqd") - .withDisplayName("jitcjczdzevn") - .withBlobDuration("krwpdap"))) - .withMetricSpecifications( - Arrays - .asList( - new MetricSpecification() - .withName("dkvwrwjfe") - .withDisplayName("nhutjeltmrldhugj") - .withDisplayDescription("datqxhocdgeabl") - .withUnit("huticndvkao") - .withAggregationType("yiftyhxhuro") - .withSupportedAggregationTypes(Arrays.asList("yxolniwp", "cukjf", "giawx")) - .withSupportedTimeGrainTypes( - Arrays.asList("ypl", "ckbasyypndd", "sgcbac", "hejkotynqgou")) - .withEnableRegionalMdmAccount(false) - .withSourceMdmAccount("likwyqkgfgib") - .withSourceMdmNamespace("dgak") - .withMetricFilterPattern("s") - .withFillGapWithZero(false) - .withCategory("zqqedq") - .withInternalMetricName("bciqfouflm") - .withDimensions(Arrays.asList()) - .withLockedAggregationType("smodmgloug"), - new MetricSpecification() - .withName("kwtmutduqktapspw") - .withDisplayName("uertumk") - .withDisplayDescription("svqwhbmdgbbjfd") - .withUnit("mbmbexppbh") - .withAggregationType("qrolfpf") - .withSupportedAggregationTypes( - Arrays.asList("lgbquxig", "yjgzjaoyfhrtxiln", "rkujy", "vlejuvfqa")) - .withSupportedTimeGrainTypes( - Arrays.asList("yxwjkcp", "bnwbxgjvtbvpyssz", "nruj", "guhmuouqfpr")) - .withEnableRegionalMdmAccount(true) - .withSourceMdmAccount("nguitnwuizgazxu") - .withSourceMdmNamespace("zuckyfi") - .withMetricFilterPattern("fidfvzw") - .withFillGapWithZero(false) - .withCategory("tymw") - .withInternalMetricName("dkfthwxmnt") - .withDimensions(Arrays.asList()) - .withLockedAggregationType("opvkmijcm"))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("zgcwrw", model.logSpecifications().get(0).name()); - Assertions.assertEquals("xxwr", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("douskcqvkocrcjdk", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dkvwrwjfe", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("nhutjeltmrldhugj", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("datqxhocdgeabl", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("huticndvkao", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("yiftyhxhuro", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("yxolniwp", model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - Assertions.assertEquals("ypl", model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(false, model.metricSpecifications().get(0).enableRegionalMdmAccount()); - Assertions.assertEquals("likwyqkgfgib", model.metricSpecifications().get(0).sourceMdmAccount()); - Assertions.assertEquals("dgak", model.metricSpecifications().get(0).sourceMdmNamespace()); - Assertions.assertEquals("s", model.metricSpecifications().get(0).metricFilterPattern()); - Assertions.assertEquals(false, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("zqqedq", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("bciqfouflm", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("smodmgloug", model.metricSpecifications().get(0).lockedAggregationType()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java deleted file mode 100644 index 31596e7061920..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = - BinaryData - .fromString( - "{\"name\":\"xjvuujqgidokg\",\"tier\":\"Standard\",\"size\":\"oxgvclt\",\"family\":\"sncghkjeszz\",\"capacity\":1537141479}") - .toObject(Sku.class); - Assertions.assertEquals("xjvuujqgidokg", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("oxgvclt", model.size()); - Assertions.assertEquals("sncghkjeszz", model.family()); - Assertions.assertEquals(1537141479, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = - new Sku() - .withName("xjvuujqgidokg") - .withTier(SkuTier.STANDARD) - .withSize("oxgvclt") - .withFamily("sncghkjeszz") - .withCapacity(1537141479); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("xjvuujqgidokg", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("oxgvclt", model.size()); - Assertions.assertEquals("sncghkjeszz", model.family()); - Assertions.assertEquals(1537141479, model.capacity()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java deleted file mode 100644 index ac80af6aab105..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountInnerTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SpatialAnchorsAccountInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpatialAnchorsAccountInner model = - BinaryData - .fromString( - "{\"properties\":{\"storageAccountName\":\"burvjxxjnspy\",\"accountId\":\"tko\",\"accountDomain\":\"kouknvudwtiu\"},\"identity\":{\"principalId\":\"dng\",\"tenantId\":\"ocipazyxoeg\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"piu\",\"tenantId\":\"ygevqzntypmrbpiz\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"j\",\"tier\":\"Free\",\"size\":\"dnfyhxdeoejzicwi\",\"family\":\"jttgzf\",\"capacity\":2101457273},\"kind\":{\"name\":\"cbkhajdeyeamdph\",\"tier\":\"Premium\",\"size\":\"pbuxwgipwhon\",\"family\":\"kgshwa\",\"capacity\":2111638773},\"location\":\"zbinjeputtm\",\"tags\":{\"ftiyqzrnkcq\":\"nuzo\",\"whzlsicohoq\":\"yx\",\"hgyxzkonoc\":\"nwvlryavwhheunmm\",\"uconuqszfkbey\":\"koklya\"},\"id\":\"ewrmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"}") - .toObject(SpatialAnchorsAccountInner.class); - Assertions.assertEquals("zbinjeputtm", model.location()); - Assertions.assertEquals("nuzo", model.tags().get("ftiyqzrnkcq")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("j", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.sku().size()); - Assertions.assertEquals("jttgzf", model.sku().family()); - Assertions.assertEquals(2101457273, model.sku().capacity()); - Assertions.assertEquals("cbkhajdeyeamdph", model.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.kind().tier()); - Assertions.assertEquals("pbuxwgipwhon", model.kind().size()); - Assertions.assertEquals("kgshwa", model.kind().family()); - Assertions.assertEquals(2111638773, model.kind().capacity()); - Assertions.assertEquals("burvjxxjnspy", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SpatialAnchorsAccountInner model = - new SpatialAnchorsAccountInner() - .withLocation("zbinjeputtm") - .withTags( - mapOf( - "ftiyqzrnkcq", - "nuzo", - "whzlsicohoq", - "yx", - "hgyxzkonoc", - "nwvlryavwhheunmm", - "uconuqszfkbey", - "koklya")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("j") - .withTier(SkuTier.FREE) - .withSize("dnfyhxdeoejzicwi") - .withFamily("jttgzf") - .withCapacity(2101457273)) - .withKind( - new Sku() - .withName("cbkhajdeyeamdph") - .withTier(SkuTier.PREMIUM) - .withSize("pbuxwgipwhon") - .withFamily("kgshwa") - .withCapacity(2111638773)) - .withStorageAccountName("burvjxxjnspy"); - model = BinaryData.fromObject(model).toObject(SpatialAnchorsAccountInner.class); - Assertions.assertEquals("zbinjeputtm", model.location()); - Assertions.assertEquals("nuzo", model.tags().get("ftiyqzrnkcq")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.plan().type()); - Assertions.assertEquals("j", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.sku().size()); - Assertions.assertEquals("jttgzf", model.sku().family()); - Assertions.assertEquals(2101457273, model.sku().capacity()); - Assertions.assertEquals("cbkhajdeyeamdph", model.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.kind().tier()); - Assertions.assertEquals("pbuxwgipwhon", model.kind().size()); - Assertions.assertEquals("kgshwa", model.kind().family()); - Assertions.assertEquals(2111638773, model.kind().capacity()); - Assertions.assertEquals("burvjxxjnspy", model.storageAccountName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int 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/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java deleted file mode 100644 index 3a4e0c10cfc36..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountPageTests.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mixedreality.fluent.models.SpatialAnchorsAccountInner; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccountPage; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SpatialAnchorsAccountPageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpatialAnchorsAccountPage model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"storageAccountName\":\"tbzaqsqsycbkbfk\",\"accountId\":\"kdkexxp\",\"accountDomain\":\"fmxa\"},\"identity\":{\"principalId\":\"jpgd\",\"tenantId\":\"ocjjxhvpmouexh\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"qeojnxqbzvddntw\",\"tenantId\":\"eic\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"pzaoqvuhr\",\"tier\":\"Free\",\"size\":\"cyddglmjthjqk\",\"family\":\"yeicxmqciwqvhk\",\"capacity\":1053923929},\"kind\":{\"name\":\"igdtopbob\",\"tier\":\"Basic\",\"size\":\"m\",\"family\":\"u\",\"capacity\":248377661},\"location\":\"hrzayvvtpgvdf\",\"tags\":{\"efgugnxk\":\"tkftutqxlngx\",\"hjybigehoqfbo\":\"xdqmidtthzrvqdra\",\"zlcuiywgqywgndrv\":\"skanyk\",\"ocpecfvmmco\":\"nhzgpphrcgyn\"},\"id\":\"fsxlzevgbmqjqa\",\"name\":\"c\",\"type\":\"pmivkwlzu\"},{\"properties\":{\"storageAccountName\":\"fwnfnb\",\"accountId\":\"fionl\",\"accountDomain\":\"x\"},\"identity\":{\"principalId\":\"gtzxdpn\",\"tenantId\":\"qqwx\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"llnwsubi\",\"tenantId\":\"jampmngnzscxaqw\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"cbonqvpk\",\"tier\":\"Premium\",\"size\":\"njeaseipheofloke\",\"family\":\"ienjbdlwtgr\",\"capacity\":1420069098},\"kind\":{\"name\":\"pj\",\"tier\":\"Premium\",\"size\":\"xazjpqyegual\",\"family\":\"xxhejjzzvd\",\"capacity\":572482803},\"location\":\"dslfhotwmcy\",\"tags\":{\"ltyfsop\":\"lbjnpgacftadehx\",\"nzwdejba\":\"usue\",\"xdn\":\"orxzdmohctbqvud\",\"wdkcglhsl\":\"nvowgujju\"},\"id\":\"zj\",\"name\":\"yggdtjixh\",\"type\":\"kuofqweykhme\"},{\"properties\":{\"storageAccountName\":\"fyexfwhy\",\"accountId\":\"i\",\"accountDomain\":\"yvdcsitynnaa\"},\"identity\":{\"principalId\":\"ctehfiqscjey\",\"tenantId\":\"hezrkgq\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"fovgmkqsleyyvxy\",\"tenantId\":\"pkc\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"ngj\",\"tier\":\"Basic\",\"size\":\"zsqpjhvmdajvny\",\"family\":\"unqecanoae\",\"capacity\":1901274446},\"kind\":{\"name\":\"yhltrpmopjmcm\",\"tier\":\"Free\",\"size\":\"kthfui\",\"family\":\"odsfcpkvxodpuozm\",\"capacity\":466984415},\"location\":\"agfuaxbezyiu\",\"tags\":{\"surex\":\"twhrdxwzywqsm\"},\"id\":\"moryocfsfksym\",\"name\":\"dystkiiuxhqyud\",\"type\":\"o\"},{\"properties\":{\"storageAccountName\":\"nbpoczvyifqrvkdv\",\"accountId\":\"llr\",\"accountDomain\":\"vdfwatkpn\"},\"identity\":{\"principalId\":\"exxbczwtr\",\"tenantId\":\"iqzbq\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"myokacspkwlh\",\"tenantId\":\"obpxjmflbvvn\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"cciw\",\"tier\":\"Free\",\"size\":\"qkhr\",\"family\":\"jiwkuofoskghsau\",\"capacity\":2118838793},\"kind\":{\"name\":\"mvxi\",\"tier\":\"Standard\",\"size\":\"gidyjrrf\",\"family\":\"aos\",\"capacity\":499062312},\"location\":\"sonpclhocohs\",\"tags\":{\"ffeii\":\"vleggzfbuhfmvfax\"},\"id\":\"hl\",\"name\":\"m\",\"type\":\"zy\"}],\"nextLink\":\"hxmzsbbzoggig\"}") - .toObject(SpatialAnchorsAccountPage.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.value().get(0).location()); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).tags().get("efgugnxk")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("pzaoqvuhr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("cyddglmjthjqk", model.value().get(0).sku().size()); - Assertions.assertEquals("yeicxmqciwqvhk", model.value().get(0).sku().family()); - Assertions.assertEquals(1053923929, model.value().get(0).sku().capacity()); - Assertions.assertEquals("igdtopbob", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("m", model.value().get(0).kind().size()); - Assertions.assertEquals("u", model.value().get(0).kind().family()); - Assertions.assertEquals(248377661, model.value().get(0).kind().capacity()); - Assertions.assertEquals("tbzaqsqsycbkbfk", model.value().get(0).storageAccountName()); - Assertions.assertEquals("hxmzsbbzoggig", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SpatialAnchorsAccountPage model = - new SpatialAnchorsAccountPage() - .withValue( - Arrays - .asList( - new SpatialAnchorsAccountInner() - .withLocation("hrzayvvtpgvdf") - .withTags( - mapOf( - "efgugnxk", - "tkftutqxlngx", - "hjybigehoqfbo", - "xdqmidtthzrvqdra", - "zlcuiywgqywgndrv", - "skanyk", - "ocpecfvmmco", - "nhzgpphrcgyn")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("pzaoqvuhr") - .withTier(SkuTier.FREE) - .withSize("cyddglmjthjqk") - .withFamily("yeicxmqciwqvhk") - .withCapacity(1053923929)) - .withKind( - new Sku() - .withName("igdtopbob") - .withTier(SkuTier.BASIC) - .withSize("m") - .withFamily("u") - .withCapacity(248377661)) - .withStorageAccountName("tbzaqsqsycbkbfk"), - new SpatialAnchorsAccountInner() - .withLocation("dslfhotwmcy") - .withTags( - mapOf( - "ltyfsop", - "lbjnpgacftadehx", - "nzwdejba", - "usue", - "xdn", - "orxzdmohctbqvud", - "wdkcglhsl", - "nvowgujju")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("cbonqvpk") - .withTier(SkuTier.PREMIUM) - .withSize("njeaseipheofloke") - .withFamily("ienjbdlwtgr") - .withCapacity(1420069098)) - .withKind( - new Sku() - .withName("pj") - .withTier(SkuTier.PREMIUM) - .withSize("xazjpqyegual") - .withFamily("xxhejjzzvd") - .withCapacity(572482803)) - .withStorageAccountName("fwnfnb"), - new SpatialAnchorsAccountInner() - .withLocation("agfuaxbezyiu") - .withTags(mapOf("surex", "twhrdxwzywqsm")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("ngj") - .withTier(SkuTier.BASIC) - .withSize("zsqpjhvmdajvny") - .withFamily("unqecanoae") - .withCapacity(1901274446)) - .withKind( - new Sku() - .withName("yhltrpmopjmcm") - .withTier(SkuTier.FREE) - .withSize("kthfui") - .withFamily("odsfcpkvxodpuozm") - .withCapacity(466984415)) - .withStorageAccountName("fyexfwhy"), - new SpatialAnchorsAccountInner() - .withLocation("sonpclhocohs") - .withTags(mapOf("ffeii", "vleggzfbuhfmvfax")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("cciw") - .withTier(SkuTier.FREE) - .withSize("qkhr") - .withFamily("jiwkuofoskghsau") - .withCapacity(2118838793)) - .withKind( - new Sku() - .withName("mvxi") - .withTier(SkuTier.STANDARD) - .withSize("gidyjrrf") - .withFamily("aos") - .withCapacity(499062312)) - .withStorageAccountName("nbpoczvyifqrvkdv"))) - .withNextLink("hxmzsbbzoggig"); - model = BinaryData.fromObject(model).toObject(SpatialAnchorsAccountPage.class); - Assertions.assertEquals("hrzayvvtpgvdf", model.value().get(0).location()); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).tags().get("efgugnxk")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).plan().type()); - Assertions.assertEquals("pzaoqvuhr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("cyddglmjthjqk", model.value().get(0).sku().size()); - Assertions.assertEquals("yeicxmqciwqvhk", model.value().get(0).sku().family()); - Assertions.assertEquals(1053923929, model.value().get(0).sku().capacity()); - Assertions.assertEquals("igdtopbob", model.value().get(0).kind().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).kind().tier()); - Assertions.assertEquals("m", model.value().get(0).kind().size()); - Assertions.assertEquals("u", model.value().get(0).kind().family()); - Assertions.assertEquals(248377661, model.value().get(0).kind().capacity()); - Assertions.assertEquals("tbzaqsqsycbkbfk", model.value().get(0).storageAccountName()); - Assertions.assertEquals("hxmzsbbzoggig", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java deleted file mode 100644 index b7bd77d1e940b..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsCreateWithResponseMockTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.Identity; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.Sku; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"storageAccountName\":\"dckcbc\",\"accountId\":\"jrjxgciqibrhosx\",\"accountDomain\":\"qrhzoymibmrqyib\"},\"identity\":{\"principalId\":\"fluszdtm\",\"tenantId\":\"kwofyyvoq\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"xpbtgiwbwo\",\"tenantId\":\"washr\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"cnqxwbpokulpi\",\"tier\":\"Basic\",\"size\":\"asipqiio\",\"family\":\"uqerpqlpqwc\",\"capacity\":1475911208},\"kind\":{\"name\":\"gbdbutauv\",\"tier\":\"Premium\",\"size\":\"uwhhmhykojoxafn\",\"family\":\"lpichk\",\"capacity\":1847154217},\"location\":\"cdyhbpkkpwdreqn\",\"tags\":{\"rsndsytgadgvra\":\"qfovljxywsuws\"},\"id\":\"aeneqnzarrwl\",\"name\":\"uu\",\"type\":\"jfqka\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SpatialAnchorsAccount response = - manager - .spatialAnchorsAccounts() - .define("pnppfuf") - .withRegion("cpwi") - .withExistingResourceGroup("vhqcrail") - .withTags(mapOf("mond", "qtmnubexkpzk", "gkopkwhojvpajqgx", "mquxvypo")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPlan(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSku( - new Sku() - .withName("lpmutwuoegrpkhj") - .withTier(SkuTier.FREE) - .withSize("qsluicp") - .withFamily("gk") - .withCapacity(2143167130)) - .withKind( - new Sku() - .withName("mbmpaxmodfvuefy") - .withTier(SkuTier.BASIC) - .withSize("fvmwy") - .withFamily("fouyf") - .withCapacity(938616277)) - .withStorageAccountName("dmhdlxyjr") - .create(); - - Assertions.assertEquals("cdyhbpkkpwdreqn", response.location()); - Assertions.assertEquals("qfovljxywsuws", response.tags().get("rsndsytgadgvra")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("cnqxwbpokulpi", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("asipqiio", response.sku().size()); - Assertions.assertEquals("uqerpqlpqwc", response.sku().family()); - Assertions.assertEquals(1475911208, response.sku().capacity()); - Assertions.assertEquals("gbdbutauv", response.kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.kind().tier()); - Assertions.assertEquals("uwhhmhykojoxafn", response.kind().size()); - Assertions.assertEquals("lpichk", response.kind().family()); - Assertions.assertEquals(1847154217, response.kind().capacity()); - Assertions.assertEquals("dckcbc", response.storageAccountName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int 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/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 687d1c8d575bb..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .spatialAnchorsAccounts() - .deleteByResourceGroupWithResponse("emwabnet", "hhszh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 2b84a624bd380..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"storageAccountName\":\"wwtppj\",\"accountId\":\"cxogaokonzm\",\"accountDomain\":\"ikvmkqzeqqk\"},\"identity\":{\"principalId\":\"fzxmhhvhgureodkw\",\"tenantId\":\"dagxtibqd\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"kbogqxndlkzgx\",\"tenantId\":\"ripl\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"xunkbebxmubyynt\",\"tier\":\"Basic\",\"size\":\"qtkoievs\",\"family\":\"tgqr\",\"capacity\":407342571},\"kind\":{\"name\":\"u\",\"tier\":\"Standard\",\"size\":\"wzizxbmpgcjefuzm\",\"family\":\"pbttdum\",\"capacity\":95905507},\"location\":\"xe\",\"tags\":{\"glkfg\":\"zbtbhj\",\"dyhtozfikdowwquu\":\"hdneuelfph\"},\"id\":\"xzxcl\",\"name\":\"ithhqzon\",\"type\":\"sg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SpatialAnchorsAccount response = - manager - .spatialAnchorsAccounts() - .getByResourceGroupWithResponse("d", "lvwiwubmwmbesl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xe", response.location()); - Assertions.assertEquals("zbtbhj", response.tags().get("glkfg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.plan().type()); - Assertions.assertEquals("xunkbebxmubyynt", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("qtkoievs", response.sku().size()); - Assertions.assertEquals("tgqr", response.sku().family()); - Assertions.assertEquals(407342571, response.sku().capacity()); - Assertions.assertEquals("u", response.kind().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.kind().tier()); - Assertions.assertEquals("wzizxbmpgcjefuzm", response.kind().size()); - Assertions.assertEquals("pbttdum", response.kind().family()); - Assertions.assertEquals(95905507, response.kind().capacity()); - Assertions.assertEquals("wwtppj", response.storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java deleted file mode 100644 index 552fb548d2e33..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"storageAccountName\":\"bpybsrfbjf\",\"accountId\":\"w\",\"accountDomain\":\"otftpvjzbexilz\"},\"identity\":{\"principalId\":\"qqnvwpmq\",\"tenantId\":\"ruoujmk\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"ytjrybnwjewgdr\",\"tenantId\":\"rvnaenqpeh\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"ygmi\",\"tier\":\"Premium\",\"size\":\"zdnds\",\"family\":\"nayqi\",\"capacity\":1427716289},\"kind\":{\"name\":\"uhavhql\",\"tier\":\"Standard\",\"size\":\"maqolbgycduie\",\"family\":\"gccymvaolpssl\",\"capacity\":1979529158},\"location\":\"mdnbbglzpswiy\",\"tags\":{\"sadbz\":\"wyhzdx\",\"dvxzbncblylpst\":\"nvdfznuda\",\"rsc\":\"bhhxsrzdzuc\"},\"id\":\"ntnev\",\"name\":\"iwjmygtdssls\",\"type\":\"tmweriofzpyq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.spatialAnchorsAccounts().listByResourceGroup("gjb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mdnbbglzpswiy", response.iterator().next().location()); - Assertions.assertEquals("wyhzdx", response.iterator().next().tags().get("sadbz")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("ygmi", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("zdnds", response.iterator().next().sku().size()); - Assertions.assertEquals("nayqi", response.iterator().next().sku().family()); - Assertions.assertEquals(1427716289, response.iterator().next().sku().capacity()); - Assertions.assertEquals("uhavhql", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().kind().tier()); - Assertions.assertEquals("maqolbgycduie", response.iterator().next().kind().size()); - Assertions.assertEquals("gccymvaolpssl", response.iterator().next().kind().family()); - Assertions.assertEquals(1979529158, response.iterator().next().kind().capacity()); - Assertions.assertEquals("bpybsrfbjf", response.iterator().next().storageAccountName()); - } -} diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java b/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java deleted file mode 100644 index ed4dad38ad1b4..0000000000000 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/src/test/java/com/azure/resourcemanager/mixedreality/generated/SpatialAnchorsAccountsListMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mixedreality.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.mixedreality.MixedRealityManager; -import com.azure.resourcemanager.mixedreality.models.ResourceIdentityType; -import com.azure.resourcemanager.mixedreality.models.SkuTier; -import com.azure.resourcemanager.mixedreality.models.SpatialAnchorsAccount; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SpatialAnchorsAccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"storageAccountName\":\"eopzfqrhhuaopp\",\"accountId\":\"qeqxo\",\"accountDomain\":\"dahzxctobg\"},\"identity\":{\"principalId\":\"moizpos\",\"tenantId\":\"grcfb\",\"type\":\"SystemAssigned\"},\"plan\":{\"principalId\":\"qjhhkxbpv\",\"tenantId\":\"mjh\",\"type\":\"SystemAssigned\"},\"sku\":{\"name\":\"n\",\"tier\":\"Basic\",\"size\":\"vkr\",\"family\":\"wbxqzvszjfau\",\"capacity\":2022160914},\"kind\":{\"name\":\"xxivetv\",\"tier\":\"Premium\",\"size\":\"qtdo\",\"family\":\"cbxvwvxyslqbh\",\"capacity\":263048903},\"location\":\"blytk\",\"tags\":{\"wwfbkrvrnsvshq\":\"pe\"},\"id\":\"ohxcrsbfova\",\"name\":\"rruvwbhsq\",\"type\":\"sub\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MixedRealityManager manager = - MixedRealityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.spatialAnchorsAccounts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("blytk", response.iterator().next().location()); - Assertions.assertEquals("pe", response.iterator().next().tags().get("wwfbkrvrnsvshq")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().plan().type()); - Assertions.assertEquals("n", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("vkr", response.iterator().next().sku().size()); - Assertions.assertEquals("wbxqzvszjfau", response.iterator().next().sku().family()); - Assertions.assertEquals(2022160914, response.iterator().next().sku().capacity()); - Assertions.assertEquals("xxivetv", response.iterator().next().kind().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().kind().tier()); - Assertions.assertEquals("qtdo", response.iterator().next().kind().size()); - Assertions.assertEquals("cbxvwvxyslqbh", response.iterator().next().kind().family()); - Assertions.assertEquals(263048903, response.iterator().next().kind().capacity()); - Assertions.assertEquals("eopzfqrhhuaopp", response.iterator().next().storageAccountName()); - } -}