diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 74328db203f0f..7b595a6f6600c 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -403,7 +403,7 @@ com.azure.resourcemanager:azure-resourcemanager-dashboard;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.0.0-beta.3;1.0.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.0.0-beta.3;1.0.0 com.azure.resourcemanager:azure-resourcemanager-workloads;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confidentialledger;1.0.0-beta.5;1.0.0 com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0;1.1.0-beta.1 diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/CHANGELOG.md b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/CHANGELOG.md index f54b7716d6ff3..e876b16d4522d 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/CHANGELOG.md +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0 (2024-12-26) -### Features Added - -### Breaking Changes - -### Bugs Fixed +- Azure Resource Manager Hardware Security Modules client library for Java. This package contains Microsoft Azure SDK for Hardware Security Modules Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Other Changes +- Release for Azure Resource Manager Hardware Security Modules client library for Java. + ## 1.0.0-beta.3 (2024-11-27) - Azure Resource Manager Hardware Security Modules client library for Java. This package contains Microsoft Azure SDK for Hardware Security Modules Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-preview-2024-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/README.md b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/README.md index 4ce1a99dbdaeb..cc81d86a86bf5 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/README.md +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Hardware Security Modules client library for Java. -This package contains Microsoft Azure SDK for Hardware Security Modules Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-preview-2024-06. 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 Hardware Security Modules Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-2021-11. 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-hardwaresecuritymodules - 1.0.0-beta.3 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/SAMPLE.md b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/SAMPLE.md index 2b33e5d35f554..f134a0a01c884 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/SAMPLE.md +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/SAMPLE.md @@ -1,37 +1,6 @@ # Code snippets and samples -## CloudHsmClusterBackupStatus - -- [Get](#cloudhsmclusterbackupstatus_get) - -## CloudHsmClusterPrivateEndpointConnections - -- [Create](#cloudhsmclusterprivateendpointconnections_create) -- [Delete](#cloudhsmclusterprivateendpointconnections_delete) -- [Get](#cloudhsmclusterprivateendpointconnections_get) - -## CloudHsmClusterPrivateLinkResources - -- [ListByCloudHsmCluster](#cloudhsmclusterprivatelinkresources_listbycloudhsmcluster) - -## CloudHsmClusterRestoreStatus - -- [Get](#cloudhsmclusterrestorestatus_get) - -## CloudHsmClusters - -- [Backup](#cloudhsmclusters_backup) -- [CreateOrUpdate](#cloudhsmclusters_createorupdate) -- [Delete](#cloudhsmclusters_delete) -- [GetByResourceGroup](#cloudhsmclusters_getbyresourcegroup) -- [List](#cloudhsmclusters_list) -- [ListByResourceGroup](#cloudhsmclusters_listbyresourcegroup) -- [Restore](#cloudhsmclusters_restore) -- [Update](#cloudhsmclusters_update) -- [ValidateBackupProperties](#cloudhsmclusters_validatebackupproperties) -- [ValidateRestoreProperties](#cloudhsmclusters_validaterestoreproperties) - ## DedicatedHsm - [CreateOrUpdate](#dedicatedhsm_createorupdate) @@ -45,507 +14,6 @@ ## Operations - [List](#operations_list) - -## PrivateEndpointConnections - -- [ListByCloudHsmCluster](#privateendpointconnections_listbycloudhsmcluster) -### CloudHsmClusterBackupStatus_Get - -```java -/** - * Samples for CloudHsmClusterBackupStatus Get. - */ -public final class CloudHsmClusterBackupStatusGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_Backup_Status_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetBackupStatusMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterBackupStatus() - .getWithResponse("rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", - com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusterPrivateEndpointConnections_Create - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; - -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Create. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsCreateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .define("sample-pec") - .withExistingCloudHsmCluster("rgcloudhsm", "chsm1") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("My name is Joe and I'm approving this."))) - .create(); - } -} -``` - -### CloudHsmClusterPrivateEndpointConnections_Delete - -```java -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Delete. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsDeleteSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .delete("rgcloudhsm", "chsm1", "sample-pec", com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusterPrivateEndpointConnections_Get - -```java -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Get. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .getWithResponse("rgcloudhsm", "chsm1", "sample-pec", com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusterPrivateLinkResources_ListByCloudHsmCluster - -```java -/** - * Samples for CloudHsmClusterPrivateLinkResources ListByCloudHsmCluster. - */ -public final class CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateLinkResources() - .listByCloudHsmCluster("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusterRestoreStatus_Get - -```java -/** - * Samples for CloudHsmClusterRestoreStatus Get. - */ -public final class CloudHsmClusterRestoreStatusGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_Restore_Status_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetRestoreStatusMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterRestoreStatus() - .getWithResponse("rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", - com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_Backup - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; - -/** - * Samples for CloudHsmClusters Backup. - */ -public final class CloudHsmClustersBackupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Create_Backup_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterCreateBackupMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .backup("rgcloudhsm", "chsm1", - new BackupRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withToken("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_CreateOrUpdate - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CloudHsmClusters CreateOrUpdate. - */ -public final class CloudHsmClustersCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterCreateOrUpdateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .define("chsm1") - .withRegion("eastus2") - .withExistingResourceGroup("rgcloudhsm") - .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1", - new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1)) - .withProperties(new CloudHsmClusterProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### CloudHsmClusters_Delete - -```java -/** - * Samples for CloudHsmClusters Delete. - */ -public final class CloudHsmClustersDeleteSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Delete_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterDeleteMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().delete("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_GetByResourceGroup - -```java -/** - * Samples for CloudHsmClusters GetByResourceGroup. - */ -public final class CloudHsmClustersGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .getByResourceGroupWithResponse("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_List - -```java -/** - * Samples for CloudHsmClusters List. - */ -public final class CloudHsmClustersListSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ListBySubscription_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterListBySubscriptionMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().list(null, com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_ListByResourceGroup - -```java -/** - * Samples for CloudHsmClusters ListByResourceGroup. - */ -public final class CloudHsmClustersListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterListByResourceGroupMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().listByResourceGroup("rgcloudhsm", null, com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_Restore - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; - -/** - * Samples for CloudHsmClusters Restore. - */ -public final class CloudHsmClustersRestoreSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Restore_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterRestoreMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .restore("rgcloudhsm", "chsm1", - new RestoreRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withBackupId("backupId"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_Update - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CloudHsmClusters Update. - */ -public final class CloudHsmClustersUpdateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Update_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterUpdateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - CloudHsmCluster resource = manager.cloudHsmClusters() - .getByResourceGroupWithResponse("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("Dept", "hsm", "Environment", "dogfood", "Slice", "A")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1", - new UserAssignedIdentity()))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### CloudHsmClusters_ValidateBackupProperties - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; - -/** - * Samples for CloudHsmClusters ValidateBackupProperties. - */ -public final class CloudHsmClustersValidateBackupPropertiesSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ValidateBackup_Validation_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterValidateBackupValidationMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .validateBackupProperties("rgcloudhsm", "chsm1", - new BackupRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withToken("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CloudHsmClusters_ValidateRestoreProperties - -```java -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; - -/** - * Samples for CloudHsmClusters ValidateRestoreProperties. - */ -public final class CloudHsmClustersValidateRestorePropertiesSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ValidateRestore_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterValidateRestoreMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .validateRestoreProperties("rgcloudhsm", "chsm1", - new RestoreRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withBackupId("backupId"), - com.azure.core.util.Context.NONE); - } -} -``` - ### DedicatedHsm_CreateOrUpdate ```java @@ -565,8 +33,8 @@ import java.util.Map; public final class DedicatedHsmCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json */ /** * Sample code: Create a new or update an existing payment HSM with management profile. @@ -579,23 +47,23 @@ public final class DedicatedHsmCreateOrUpdateSamples { .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) - .withManagementNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withManagementNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.2")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .create(); } /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_CreateOrUpdate.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_CreateOrUpdate.json */ /** * Sample code: Create a new or update an existing dedicated HSM. @@ -608,20 +76,20 @@ public final class DedicatedHsmCreateOrUpdateSamples { .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) .create(); } /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_CreateOrUpdate.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_CreateOrUpdate.json */ /** * Sample code: Create a new or update an existing payment HSM. @@ -634,13 +102,13 @@ public final class DedicatedHsmCreateOrUpdateSamples { .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .create(); } @@ -667,8 +135,8 @@ public final class DedicatedHsmCreateOrUpdateSamples { public final class DedicatedHsmDeleteSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Delete.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Delete.json */ /** * Sample code: Delete a dedicated HSM. @@ -691,8 +159,8 @@ public final class DedicatedHsmDeleteSamples { public final class DedicatedHsmGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Get.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Get.json */ /** * Sample code: Get a payment HSM. @@ -706,8 +174,8 @@ public final class DedicatedHsmGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json */ /** * Sample code: Get a payment HSM with 2018-10-31Preview api version. @@ -721,8 +189,8 @@ public final class DedicatedHsmGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Get.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Get.json */ /** * Sample code: Get a dedicated HSM. @@ -745,8 +213,8 @@ public final class DedicatedHsmGetByResourceGroupSamples { public final class DedicatedHsmListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_ListBySubscription.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_ListBySubscription.json */ /** * Sample code: List dedicated HSM devices in a subscription including payment HSM. @@ -760,8 +228,8 @@ public final class DedicatedHsmListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_ListBySubscription.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_ListBySubscription.json */ /** * Sample code: List dedicated HSM devices in a subscription. @@ -784,8 +252,8 @@ public final class DedicatedHsmListSamples { public final class DedicatedHsmListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_ListByResourceGroup.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_ListByResourceGroup.json */ /** * Sample code: List dedicated HSM devices in a resource group. @@ -799,8 +267,8 @@ public final class DedicatedHsmListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_ListByResourceGroup.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_ListByResourceGroup.json */ /** * Sample code: List dedicated HSM devices in a resource group including payment HSM. @@ -823,8 +291,8 @@ public final class DedicatedHsmListByResourceGroupSamples { public final class DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/GetOutboundNetworkDependenciesEndpointsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/GetOutboundNetworkDependenciesEndpointsList.json */ /** * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. @@ -852,8 +320,8 @@ import java.util.Map; public final class DedicatedHsmUpdateSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Update.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Update.json */ /** * Sample code: Update an existing dedicated HSM. @@ -870,8 +338,8 @@ public final class DedicatedHsmUpdateSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Update.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Update.json */ /** * Sample code: Update an existing payment HSM. @@ -909,8 +377,8 @@ public final class DedicatedHsmUpdateSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/OperationsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_OperationsList.json */ /** * Sample code: Get a list of Payment HSM operations. @@ -924,8 +392,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/OperationsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_OperationsList.json */ /** * Sample code: Get a list of Dedicated HSM operations. @@ -939,28 +407,3 @@ public final class OperationsListSamples { } ``` -### PrivateEndpointConnections_ListByCloudHsmCluster - -```java -/** - * Samples for PrivateEndpointConnections ListByCloudHsmCluster. - */ -public final class PrivateEndpointConnectionsListByCloudHsmClusterSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_ListByResource_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.privateEndpointConnections() - .listByCloudHsmCluster("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml index 6be548f73ee8f..b4ccb1d191ee7 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-hardwaresecuritymodules - 1.0.0-beta.4 + 1.0.0 jar Microsoft Azure SDK for Hardware Security Modules Management - This package contains Microsoft Azure SDK for Hardware Security Modules Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-preview-2024-06. + This package contains Microsoft Azure SDK for Hardware Security Modules Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. Package tag package-2021-11. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true false diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/HardwareSecurityModulesManager.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/HardwareSecurityModulesManager.java index fbccea7bdc71a..f8df0259a194c 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/HardwareSecurityModulesManager.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/HardwareSecurityModulesManager.java @@ -25,22 +25,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hardwaresecuritymodules.fluent.AzureHsmResourceProvider; import com.azure.resourcemanager.hardwaresecuritymodules.implementation.AzureHsmResourceProviderBuilder; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterBackupStatusImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterPrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterPrivateLinkResourcesImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterRestoreStatusImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClustersImpl; import com.azure.resourcemanager.hardwaresecuritymodules.implementation.DedicatedHsmsImpl; import com.azure.resourcemanager.hardwaresecuritymodules.implementation.OperationsImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.implementation.PrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterBackupStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPrivateEndpointConnections; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPrivateLinkResources; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterRestoreStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusters; import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsms; import com.azure.resourcemanager.hardwaresecuritymodules.models.Operations; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnections; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -53,22 +41,10 @@ * The Azure management API provides a RESTful set of web services that interact with Azure HSM RP. */ public final class HardwareSecurityModulesManager { - private CloudHsmClusters cloudHsmClusters; - - private CloudHsmClusterPrivateLinkResources cloudHsmClusterPrivateLinkResources; - - private CloudHsmClusterPrivateEndpointConnections cloudHsmClusterPrivateEndpointConnections; - - private PrivateEndpointConnections privateEndpointConnections; - - private CloudHsmClusterBackupStatus cloudHsmClusterBackupStatus; - - private CloudHsmClusterRestoreStatus cloudHsmClusterRestoreStatus; + private Operations operations; private DedicatedHsms dedicatedHsms; - private Operations operations; - private final AzureHsmResourceProvider clientObject; private HardwareSecurityModulesManager(HttpPipeline httpPipeline, AzureProfile profile, @@ -235,7 +211,7 @@ public HardwareSecurityModulesManager authenticate(TokenCredential credential, A .append("-") .append("com.azure.resourcemanager.hardwaresecuritymodules") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -282,81 +258,15 @@ public HardwareSecurityModulesManager authenticate(TokenCredential credential, A } /** - * Gets the resource collection API of CloudHsmClusters. It manages CloudHsmCluster. - * - * @return Resource collection API of CloudHsmClusters. - */ - public CloudHsmClusters cloudHsmClusters() { - if (this.cloudHsmClusters == null) { - this.cloudHsmClusters = new CloudHsmClustersImpl(clientObject.getCloudHsmClusters(), this); - } - return cloudHsmClusters; - } - - /** - * Gets the resource collection API of CloudHsmClusterPrivateLinkResources. - * - * @return Resource collection API of CloudHsmClusterPrivateLinkResources. - */ - public CloudHsmClusterPrivateLinkResources cloudHsmClusterPrivateLinkResources() { - if (this.cloudHsmClusterPrivateLinkResources == null) { - this.cloudHsmClusterPrivateLinkResources = new CloudHsmClusterPrivateLinkResourcesImpl( - clientObject.getCloudHsmClusterPrivateLinkResources(), this); - } - return cloudHsmClusterPrivateLinkResources; - } - - /** - * Gets the resource collection API of CloudHsmClusterPrivateEndpointConnections. It manages - * PrivateEndpointConnection. - * - * @return Resource collection API of CloudHsmClusterPrivateEndpointConnections. - */ - public CloudHsmClusterPrivateEndpointConnections cloudHsmClusterPrivateEndpointConnections() { - if (this.cloudHsmClusterPrivateEndpointConnections == null) { - this.cloudHsmClusterPrivateEndpointConnections = new CloudHsmClusterPrivateEndpointConnectionsImpl( - clientObject.getCloudHsmClusterPrivateEndpointConnections(), this); - } - return cloudHsmClusterPrivateEndpointConnections; - } - - /** - * Gets the resource collection API of PrivateEndpointConnections. - * - * @return Resource collection API of PrivateEndpointConnections. - */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); - } - return privateEndpointConnections; - } - - /** - * Gets the resource collection API of CloudHsmClusterBackupStatus. - * - * @return Resource collection API of CloudHsmClusterBackupStatus. - */ - public CloudHsmClusterBackupStatus cloudHsmClusterBackupStatus() { - if (this.cloudHsmClusterBackupStatus == null) { - this.cloudHsmClusterBackupStatus - = new CloudHsmClusterBackupStatusImpl(clientObject.getCloudHsmClusterBackupStatus(), this); - } - return cloudHsmClusterBackupStatus; - } - - /** - * Gets the resource collection API of CloudHsmClusterRestoreStatus. + * Gets the resource collection API of Operations. * - * @return Resource collection API of CloudHsmClusterRestoreStatus. + * @return Resource collection API of Operations. */ - public CloudHsmClusterRestoreStatus cloudHsmClusterRestoreStatus() { - if (this.cloudHsmClusterRestoreStatus == null) { - this.cloudHsmClusterRestoreStatus - = new CloudHsmClusterRestoreStatusImpl(clientObject.getCloudHsmClusterRestoreStatus(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return cloudHsmClusterRestoreStatus; + return operations; } /** @@ -371,18 +281,6 @@ public DedicatedHsms dedicatedHsms() { return dedicatedHsms; } - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** * Gets wrapped service client AzureHsmResourceProvider providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/AzureHsmResourceProvider.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/AzureHsmResourceProvider.java index 9df5d59c7e457..0d4466715200c 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/AzureHsmResourceProvider.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/AzureHsmResourceProvider.java @@ -12,7 +12,7 @@ */ public interface AzureHsmResourceProvider { /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -47,46 +47,11 @@ public interface AzureHsmResourceProvider { Duration getDefaultPollInterval(); /** - * Gets the CloudHsmClustersClient object to access its operations. - * - * @return the CloudHsmClustersClient object. - */ - CloudHsmClustersClient getCloudHsmClusters(); - - /** - * Gets the CloudHsmClusterPrivateLinkResourcesClient object to access its operations. - * - * @return the CloudHsmClusterPrivateLinkResourcesClient object. - */ - CloudHsmClusterPrivateLinkResourcesClient getCloudHsmClusterPrivateLinkResources(); - - /** - * Gets the CloudHsmClusterPrivateEndpointConnectionsClient object to access its operations. - * - * @return the CloudHsmClusterPrivateEndpointConnectionsClient object. - */ - CloudHsmClusterPrivateEndpointConnectionsClient getCloudHsmClusterPrivateEndpointConnections(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the CloudHsmClusterBackupStatusClient object to access its operations. - * - * @return the CloudHsmClusterBackupStatusClient object. - */ - CloudHsmClusterBackupStatusClient getCloudHsmClusterBackupStatus(); - - /** - * Gets the CloudHsmClusterRestoreStatusClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the CloudHsmClusterRestoreStatusClient object. + * @return the OperationsClient object. */ - CloudHsmClusterRestoreStatusClient getCloudHsmClusterRestoreStatus(); + OperationsClient getOperations(); /** * Gets the DedicatedHsmsClient object to access its operations. @@ -94,11 +59,4 @@ public interface AzureHsmResourceProvider { * @return the DedicatedHsmsClient object. */ DedicatedHsmsClient getDedicatedHsms(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterBackupStatusClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterBackupStatusClient.java deleted file mode 100644 index a972254e8f418..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterBackupStatusClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterBackupStatusGetResponse; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterBackupStatusClient. - */ -public interface CloudHsmClusterBackupStatusClient { - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterBackupStatusGetResponse getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String jobId, Context context); - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResultInner get(String resourceGroupName, String cloudHsmClusterName, String jobId); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateEndpointConnectionsClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateEndpointConnectionsClient.java deleted file mode 100644 index 3871a5e8af963..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; - -/** - * An instance of this class provides access to all the operations defined in - * CloudHsmClusterPrivateEndpointConnectionsClient. - */ -public interface CloudHsmClusterPrivateEndpointConnectionsClient { - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, PrivateEndpointConnectionInner properties, Context context); - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner create(String resourceGroupName, String cloudHsmClusterName, String peConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 cloudHsmClusterName, String peConnectionName); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 cloudHsmClusterName, String peConnectionName, Context context); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String resourceGroupName, String cloudHsmClusterName, String peConnectionName); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateLinkResourcesClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateLinkResourcesClient.java deleted file mode 100644 index e2a91915c0fc6..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterPrivateLinkResourcesClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterPrivateLinkResourcesClient. - */ -public interface CloudHsmClusterPrivateLinkResourcesClient { - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName); - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName, - Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterRestoreStatusClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterRestoreStatusClient.java deleted file mode 100644 index 1d13e6ed369e7..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClusterRestoreStatusClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterRestoreStatusGetResponse; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterRestoreStatusClient. - */ -public interface CloudHsmClusterRestoreStatusClient { - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterRestoreStatusGetResponse getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String jobId, Context context); - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreResultInner get(String resourceGroupName, String cloudHsmClusterName, String jobId); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClustersClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClustersClient.java deleted file mode 100644 index fd5f3571a52a5..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/CloudHsmClustersClient.java +++ /dev/null @@ -1,555 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPatchParameters; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClustersClient. - */ -public interface CloudHsmClustersClient { - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudHsmClusterInner> beginCreateOrUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterInner body); - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudHsmClusterInner> beginCreateOrUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterInner body, Context context); - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterInner createOrUpdate(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterInner body); - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterInner createOrUpdate(String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterInner body, - Context context); - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudHsmClusterInner> beginUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body); - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudHsmClusterInner> beginUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body, Context context); - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterInner update(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body); - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterInner update(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body, Context context); - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String cloudHsmClusterName, - Context context); - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudHsmClusterInner getByResourceGroup(String resourceGroupName, String cloudHsmClusterName); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - Context context); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 cloudHsmClusterName); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 cloudHsmClusterName, Context context); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, - Context context); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the 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 list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String skiptoken, Context context); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupResultInner> beginValidateBackupProperties(String resourceGroupName, - String cloudHsmClusterName); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupResultInner> beginValidateBackupProperties(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, Context context); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResultInner validateBackupProperties(String resourceGroupName, String cloudHsmClusterName); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResultInner validateBackupProperties(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupResultInner> beginBackup(String resourceGroupName, - String cloudHsmClusterName); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupResultInner> beginBackup(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, Context context); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResultInner backup(String resourceGroupName, String cloudHsmClusterName); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResultInner backup(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RestoreResultInner> - beginValidateRestoreProperties(String resourceGroupName, String cloudHsmClusterName); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RestoreResultInner> beginValidateRestoreProperties( - String resourceGroupName, String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, - Context context); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreResultInner validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreResultInner validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RestoreResultInner> beginRestore(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RestoreResultInner> beginRestore(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, Context context); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreResultInner restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestoreResultInner restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/DedicatedHsmsClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/DedicatedHsmsClient.java index 22925598be752..d183682ecdeb2 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/DedicatedHsmsClient.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/DedicatedHsmsClient.java @@ -22,7 +22,7 @@ public interface DedicatedHsmsClient { /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -38,7 +38,7 @@ SyncPoller, DedicatedHsmInner> beginCreateOrUpdate /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -55,7 +55,7 @@ SyncPoller, DedicatedHsmInner> beginCreateOrUpdate /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,7 +70,7 @@ SyncPoller, DedicatedHsmInner> beginCreateOrUpdate /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -87,8 +87,8 @@ DedicatedHsmInner createOrUpdate(String resourceGroupName, String name, Dedicate /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -103,8 +103,8 @@ SyncPoller, DedicatedHsmInner> beginUpdate(String /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -120,8 +120,8 @@ SyncPoller, DedicatedHsmInner> beginUpdate(String /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -135,8 +135,8 @@ SyncPoller, DedicatedHsmInner> beginUpdate(String /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -152,8 +152,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -166,8 +166,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -181,8 +181,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -194,8 +194,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -208,8 +208,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -223,8 +223,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -238,7 +238,7 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -252,7 +252,7 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -296,8 +296,8 @@ DedicatedHsmInner update(String resourceGroupName, String name, DedicatedHsmPatc * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -316,8 +316,8 @@ PagedIterable listOutboundNetworkDependenciesE * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/OperationsClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/OperationsClient.java index 332478729f32d..79d782a25a914 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/OperationsClient.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/OperationsClient.java @@ -8,31 +8,33 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; /** * An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected + * by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected + * by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/PrivateEndpointConnectionsClient.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 0d485423766a8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public interface PrivateEndpointConnectionsClient { - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName); - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName, Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/BackupResultInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/BackupResultInner.java deleted file mode 100644 index 740d3ccf06d1d..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/BackupResultInner.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResultProperties; -import java.io.IOException; - -/** - * Backup operation Result. - */ -@Fluent -public final class BackupResultInner implements JsonSerializable { - /* - * Properties of the Cloud HSM Cluster - */ - private BackupResultProperties properties; - - /** - * Creates an instance of BackupResultInner class. - */ - public BackupResultInner() { - } - - /** - * Get the properties property: Properties of the Cloud HSM Cluster. - * - * @return the properties value. - */ - public BackupResultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the Cloud HSM Cluster. - * - * @param properties the properties value to set. - * @return the BackupResultInner object itself. - */ - public BackupResultInner withProperties(BackupResultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResultInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupResultInner. - */ - public static BackupResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResultInner deserializedBackupResultInner = new BackupResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedBackupResultInner.properties = BackupResultProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResultInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/CloudHsmClusterInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/CloudHsmClusterInner.java deleted file mode 100644 index c718aed2e5544..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/CloudHsmClusterInner.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterResource; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import java.io.IOException; -import java.util.Map; - -/** - * Resource information with extended details. - */ -@Fluent -public final class CloudHsmClusterInner extends CloudHsmClusterResource { - /* - * Properties of the Cloud HSM Cluster - */ - private CloudHsmClusterProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CloudHsmClusterInner class. - */ - public CloudHsmClusterInner() { - } - - /** - * Get the properties property: Properties of the Cloud HSM Cluster. - * - * @return the properties value. - */ - public CloudHsmClusterProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the Cloud HSM Cluster. - * - * @param properties the properties value to set. - * @return the CloudHsmClusterInner object itself. - */ - public CloudHsmClusterInner withProperties(CloudHsmClusterProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - @Override - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public CloudHsmClusterInner withIdentity(ManagedServiceIdentity identity) { - super.withIdentity(identity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CloudHsmClusterInner withSku(CloudHsmClusterSku sku) { - super.withSku(sku); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CloudHsmClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CloudHsmClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", identity()); - jsonWriter.writeJsonField("sku", sku()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmClusterInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CloudHsmClusterInner. - */ - public static CloudHsmClusterInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmClusterInner deserializedCloudHsmClusterInner = new CloudHsmClusterInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCloudHsmClusterInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCloudHsmClusterInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCloudHsmClusterInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedCloudHsmClusterInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCloudHsmClusterInner.withTags(tags); - } else if ("identity".equals(fieldName)) { - deserializedCloudHsmClusterInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); - } else if ("sku".equals(fieldName)) { - deserializedCloudHsmClusterInner.withSku(CloudHsmClusterSku.fromJson(reader)); - } else if ("systemData".equals(fieldName)) { - deserializedCloudHsmClusterInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedCloudHsmClusterInner.properties = CloudHsmClusterProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmClusterInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmInner.java index 790b84b72c895..c157dc5e3c36c 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmInner.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmProperties; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmResource; import com.azure.resourcemanager.hardwaresecuritymodules.models.Sku; import java.io.IOException; import java.util.List; @@ -21,27 +21,17 @@ * Resource information with extended details. */ @Fluent -public final class DedicatedHsmInner extends Resource { +public final class DedicatedHsmInner extends DedicatedHsmResource { /* - * SKU details + * Metadata pertaining to creation and last modification of the resource */ - private Sku sku; - - /* - * The Dedicated Hsm zones. - */ - private List zones; + private SystemData systemData; /* * Properties of the dedicated HSM */ private DedicatedHsmProperties properties; - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - /* * The type of the resource. */ @@ -64,43 +54,12 @@ public DedicatedHsmInner() { } /** - * Get the sku property: SKU details. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: SKU details. - * - * @param sku the sku value to set. - * @return the DedicatedHsmInner object itself. - */ - public DedicatedHsmInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the zones property: The Dedicated Hsm zones. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: The Dedicated Hsm zones. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @param zones the zones value to set. - * @return the DedicatedHsmInner object itself. + * @return the systemData value. */ - public DedicatedHsmInner withZones(List zones) { - this.zones = zones; - return this; + public SystemData systemData() { + return this.systemData; } /** @@ -123,15 +82,6 @@ public DedicatedHsmInner withProperties(DedicatedHsmProperties properties) { return this; } - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - /** * Get the type property: The type of the resource. * @@ -162,6 +112,24 @@ public String id() { return this.id; } + /** + * {@inheritDoc} + */ + @Override + public DedicatedHsmInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DedicatedHsmInner withZones(List zones) { + super.withZones(zones); + return this; + } + /** * {@inheritDoc} */ @@ -185,19 +153,17 @@ public DedicatedHsmInner withTags(Map tags) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { - if (sku() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property sku in model DedicatedHsmInner")); - } else { - sku().validate(); - } if (properties() == null) { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property properties in model DedicatedHsmInner")); } else { properties().validate(); } + if (sku() != null) { + sku().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(DedicatedHsmInner.class); @@ -210,9 +176,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("sku", sku()); + jsonWriter.writeArrayField("zones", zones(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -244,12 +210,12 @@ public static DedicatedHsmInner fromJson(JsonReader jsonReader) throws IOExcepti Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedDedicatedHsmInner.withTags(tags); } else if ("sku".equals(fieldName)) { - deserializedDedicatedHsmInner.sku = Sku.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDedicatedHsmInner.properties = DedicatedHsmProperties.fromJson(reader); + deserializedDedicatedHsmInner.withSku(Sku.fromJson(reader)); } else if ("zones".equals(fieldName)) { List zones = reader.readArray(reader1 -> reader1.getString()); - deserializedDedicatedHsmInner.zones = zones; + deserializedDedicatedHsmInner.withZones(zones); + } else if ("properties".equals(fieldName)) { + deserializedDedicatedHsmInner.properties = DedicatedHsmProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDedicatedHsmInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmOperationInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmOperationInner.java new file mode 100644 index 0000000000000..817e6fb51ed0f --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/DedicatedHsmOperationInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay; +import java.io.IOException; + +/** + * REST API operation. + */ +@Fluent +public final class DedicatedHsmOperationInner implements JsonSerializable { + /* + * The name of the Dedicated HSM Resource Provider Operation. + */ + private String name; + + /* + * Gets or sets a value indicating whether it is a data plane action + */ + private Boolean isDataAction; + + /* + * The origin of the operation + */ + private String origin; + + /* + * The display string. + */ + private DedicatedHsmOperationDisplay display; + + /** + * Creates an instance of DedicatedHsmOperationInner class. + */ + public DedicatedHsmOperationInner() { + } + + /** + * Get the name property: The name of the Dedicated HSM Resource Provider Operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Dedicated HSM Resource Provider Operation. + * + * @param name the name value to set. + * @return the DedicatedHsmOperationInner object itself. + */ + public DedicatedHsmOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Gets or sets a value indicating whether it is a data plane action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the origin property: The origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin of the operation. + * + * @param origin the origin value to set. + * @return the DedicatedHsmOperationInner object itself. + */ + public DedicatedHsmOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the display property: The display string. + * + * @return the display value. + */ + public DedicatedHsmOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The display string. + * + * @param display the display value to set. + * @return the DedicatedHsmOperationInner object itself. + */ + public DedicatedHsmOperationInner withDisplay(DedicatedHsmOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DedicatedHsmOperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DedicatedHsmOperationInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DedicatedHsmOperationInner. + */ + public static DedicatedHsmOperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DedicatedHsmOperationInner deserializedDedicatedHsmOperationInner = new DedicatedHsmOperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDedicatedHsmOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedDedicatedHsmOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedDedicatedHsmOperationInner.origin = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedDedicatedHsmOperationInner.display = DedicatedHsmOperationDisplay.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDedicatedHsmOperationInner; + }); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/OperationInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/OperationInner.java deleted file mode 100644 index 6650c4c33ab1f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/OperationInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ActionType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationDisplay; -import com.azure.resourcemanager.hardwaresecuritymodules.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Fluent -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationInner. - */ - public static OperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInner deserializedOperationInner = new OperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInner.name = reader.getString(); - } else if ("isDataAction".equals(fieldName)) { - deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateEndpointConnectionInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 5db903d587779..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import java.io.IOException; - -/** - * The private endpoint connection resource. - */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - /* - * Resource properties. - */ - private PrivateEndpointConnectionProperties properties; - - /* - * Modified whenever there is a change in the state of private endpoint connection. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of PrivateEndpointConnectionInner class. - */ - public PrivateEndpointConnectionInner() { - } - - /** - * Get the properties property: Resource properties. - * - * @return the properties value. - */ - public PrivateEndpointConnectionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Resource properties. - * - * @param properties the properties value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @param etag the etag value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. - */ - public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner - = new PrivateEndpointConnectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.properties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateLinkResourceInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateLinkResourceInner.java deleted file mode 100644 index e480642b2f213..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/PrivateLinkResourceInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceProperties; -import java.io.IOException; - -/** - * A private link resource. - */ -@Fluent -public final class PrivateLinkResourceInner extends ProxyResource { - /* - * Resource properties. - */ - private PrivateLinkResourceProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of PrivateLinkResourceInner class. - */ - public PrivateLinkResourceInner() { - } - - /** - * Get the properties property: Resource properties. - * - * @return the properties value. - */ - public PrivateLinkResourceProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Resource properties. - * - * @param properties the properties value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. - */ - public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateLinkResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateLinkResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateLinkResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateLinkResourceInner.properties = PrivateLinkResourceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/RestoreResultInner.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/RestoreResultInner.java deleted file mode 100644 index 8101c07165f06..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/fluent/models/RestoreResultInner.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRestoreBaseResultProperties; -import java.io.IOException; - -/** - * Restore operation properties. - */ -@Fluent -public final class RestoreResultInner implements JsonSerializable { - /* - * Backup and Restore operation common properties - */ - private BackupRestoreBaseResultProperties properties; - - /** - * Creates an instance of RestoreResultInner class. - */ - public RestoreResultInner() { - } - - /** - * Get the properties property: Backup and Restore operation common properties. - * - * @return the properties value. - */ - public BackupRestoreBaseResultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Backup and Restore operation common properties. - * - * @param properties the properties value to set. - * @return the RestoreResultInner object itself. - */ - public RestoreResultInner withProperties(BackupRestoreBaseResultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RestoreResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RestoreResultInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the RestoreResultInner. - */ - public static RestoreResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RestoreResultInner deserializedRestoreResultInner = new RestoreResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedRestoreResultInner.properties = BackupRestoreBaseResultProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRestoreResultInner; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderBuilder.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderBuilder.java index c1dc1f47a7e9b..b85c3c845e0c4 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderBuilder.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { AzureHsmResourceProviderImpl.class }) public final class AzureHsmResourceProviderBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the AzureHsmResourceProviderBuilder. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderImpl.java index 2a7da9c0da3ed..7547544257421 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/AzureHsmResourceProviderImpl.java @@ -24,14 +24,8 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hardwaresecuritymodules.fluent.AzureHsmResourceProvider; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterBackupStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateEndpointConnectionsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateLinkResourcesClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterRestoreStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClustersClient; import com.azure.resourcemanager.hardwaresecuritymodules.fluent.DedicatedHsmsClient; import com.azure.resourcemanager.hardwaresecuritymodules.fluent.OperationsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.PrivateEndpointConnectionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -47,12 +41,12 @@ @ServiceClient(builder = AzureHsmResourceProviderBuilder.class) public final class AzureHsmResourceProviderImpl implements AzureHsmResourceProvider { /** - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -131,87 +125,17 @@ public Duration getDefaultPollInterval() { } /** - * The CloudHsmClustersClient object to access its operations. - */ - private final CloudHsmClustersClient cloudHsmClusters; - - /** - * Gets the CloudHsmClustersClient object to access its operations. - * - * @return the CloudHsmClustersClient object. - */ - public CloudHsmClustersClient getCloudHsmClusters() { - return this.cloudHsmClusters; - } - - /** - * The CloudHsmClusterPrivateLinkResourcesClient object to access its operations. - */ - private final CloudHsmClusterPrivateLinkResourcesClient cloudHsmClusterPrivateLinkResources; - - /** - * Gets the CloudHsmClusterPrivateLinkResourcesClient object to access its operations. - * - * @return the CloudHsmClusterPrivateLinkResourcesClient object. - */ - public CloudHsmClusterPrivateLinkResourcesClient getCloudHsmClusterPrivateLinkResources() { - return this.cloudHsmClusterPrivateLinkResources; - } - - /** - * The CloudHsmClusterPrivateEndpointConnectionsClient object to access its operations. - */ - private final CloudHsmClusterPrivateEndpointConnectionsClient cloudHsmClusterPrivateEndpointConnections; - - /** - * Gets the CloudHsmClusterPrivateEndpointConnectionsClient object to access its operations. - * - * @return the CloudHsmClusterPrivateEndpointConnectionsClient object. - */ - public CloudHsmClusterPrivateEndpointConnectionsClient getCloudHsmClusterPrivateEndpointConnections() { - return this.cloudHsmClusterPrivateEndpointConnections; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The CloudHsmClusterBackupStatusClient object to access its operations. - */ - private final CloudHsmClusterBackupStatusClient cloudHsmClusterBackupStatus; - - /** - * Gets the CloudHsmClusterBackupStatusClient object to access its operations. - * - * @return the CloudHsmClusterBackupStatusClient object. - */ - public CloudHsmClusterBackupStatusClient getCloudHsmClusterBackupStatus() { - return this.cloudHsmClusterBackupStatus; - } - - /** - * The CloudHsmClusterRestoreStatusClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final CloudHsmClusterRestoreStatusClient cloudHsmClusterRestoreStatus; + private final OperationsClient operations; /** - * Gets the CloudHsmClusterRestoreStatusClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the CloudHsmClusterRestoreStatusClient object. + * @return the OperationsClient object. */ - public CloudHsmClusterRestoreStatusClient getCloudHsmClusterRestoreStatus() { - return this.cloudHsmClusterRestoreStatus; + public OperationsClient getOperations() { + return this.operations; } /** @@ -228,20 +152,6 @@ public DedicatedHsmsClient getDedicatedHsms() { return this.dedicatedHsms; } - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - /** * Initializes an instance of AzureHsmResourceProvider client. * @@ -249,7 +159,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ AzureHsmResourceProviderImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -259,15 +169,9 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-06-30-preview"; - this.cloudHsmClusters = new CloudHsmClustersClientImpl(this); - this.cloudHsmClusterPrivateLinkResources = new CloudHsmClusterPrivateLinkResourcesClientImpl(this); - this.cloudHsmClusterPrivateEndpointConnections = new CloudHsmClusterPrivateEndpointConnectionsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.cloudHsmClusterBackupStatus = new CloudHsmClusterBackupStatusClientImpl(this); - this.cloudHsmClusterRestoreStatus = new CloudHsmClusterRestoreStatusClientImpl(this); - this.dedicatedHsms = new DedicatedHsmsClientImpl(this); + this.apiVersion = "2021-11-30"; this.operations = new OperationsClientImpl(this); + this.dedicatedHsms = new DedicatedHsmsClientImpl(this); } /** diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/BackupResultImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/BackupResultImpl.java deleted file mode 100644 index bcb6071fe0792..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/BackupResultImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResultProperties; - -public final class BackupResultImpl implements BackupResult { - private BackupResultInner innerObject; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - BackupResultImpl(BackupResultInner innerObject, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public BackupResultProperties properties() { - return this.innerModel().properties(); - } - - public BackupResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusClientImpl.java deleted file mode 100644 index 087d2c3798c7e..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusClientImpl.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterBackupStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterBackupStatusGetResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterBackupStatusClient. - */ -public final class CloudHsmClusterBackupStatusClientImpl implements CloudHsmClusterBackupStatusClient { - /** - * The proxy service used to perform REST calls. - */ - private final CloudHsmClusterBackupStatusService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of CloudHsmClusterBackupStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CloudHsmClusterBackupStatusClientImpl(AzureHsmResourceProviderImpl client) { - this.service = RestProxy.create(CloudHsmClusterBackupStatusService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderCloudHsmClusterBackupStatus to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface CloudHsmClusterBackupStatusService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String jobId) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (jobId == null) { - return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), jobId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String jobId, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (jobId == null) { - return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), jobId, accept, context); - } - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String cloudHsmClusterName, String jobId) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, jobId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterBackupStatusGetResponse getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String jobId, Context context) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, jobId, context).block(); - } - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResultInner get(String resourceGroupName, String cloudHsmClusterName, String jobId) { - return getWithResponse(resourceGroupName, cloudHsmClusterName, jobId, Context.NONE).getValue(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusImpl.java deleted file mode 100644 index 57c18645c134c..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterBackupStatusImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -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.hardwaresecuritymodules.fluent.CloudHsmClusterBackupStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterBackupStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterBackupStatusGetResponse; - -public final class CloudHsmClusterBackupStatusImpl implements CloudHsmClusterBackupStatus { - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClusterBackupStatusImpl.class); - - private final CloudHsmClusterBackupStatusClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public CloudHsmClusterBackupStatusImpl(CloudHsmClusterBackupStatusClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, String jobId, - Context context) { - CloudHsmClusterBackupStatusGetResponse inner - = this.serviceClient().getWithResponse(resourceGroupName, cloudHsmClusterName, jobId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BackupResult get(String resourceGroupName, String cloudHsmClusterName, String jobId) { - BackupResultInner inner = this.serviceClient().get(resourceGroupName, cloudHsmClusterName, jobId); - if (inner != null) { - return new BackupResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private CloudHsmClusterBackupStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterImpl.java deleted file mode 100644 index e789beddfcb52..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterImpl.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPatchParameters; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreResult; -import java.util.Collections; -import java.util.Map; - -public final class CloudHsmClusterImpl implements CloudHsmCluster, CloudHsmCluster.Definition, CloudHsmCluster.Update { - private CloudHsmClusterInner innerObject; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ManagedServiceIdentity identity() { - return this.innerModel().identity(); - } - - public CloudHsmClusterSku sku() { - return this.innerModel().sku(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public CloudHsmClusterProperties properties() { - return this.innerModel().properties(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public CloudHsmClusterInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String cloudHsmClusterName; - - private CloudHsmClusterPatchParameters updateBody; - - public CloudHsmClusterImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public CloudHsmCluster create() { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .createOrUpdate(resourceGroupName, cloudHsmClusterName, this.innerModel(), Context.NONE); - return this; - } - - public CloudHsmCluster create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .createOrUpdate(resourceGroupName, cloudHsmClusterName, this.innerModel(), context); - return this; - } - - CloudHsmClusterImpl(String name, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = new CloudHsmClusterInner(); - this.serviceManager = serviceManager; - this.cloudHsmClusterName = name; - } - - public CloudHsmClusterImpl update() { - this.updateBody = new CloudHsmClusterPatchParameters(); - return this; - } - - public CloudHsmCluster apply() { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .update(resourceGroupName, cloudHsmClusterName, updateBody, Context.NONE); - return this; - } - - public CloudHsmCluster apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .update(resourceGroupName, cloudHsmClusterName, updateBody, context); - return this; - } - - CloudHsmClusterImpl(CloudHsmClusterInner innerObject, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudHsmClusters"); - } - - public CloudHsmCluster refresh() { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, Context.NONE) - .getValue(); - return this; - } - - public CloudHsmCluster refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusters() - .getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, context) - .getValue(); - return this; - } - - public BackupResult validateBackupProperties() { - return serviceManager.cloudHsmClusters().validateBackupProperties(resourceGroupName, cloudHsmClusterName); - } - - public BackupResult validateBackupProperties(BackupRequestProperties backupRequestProperties, Context context) { - return serviceManager.cloudHsmClusters() - .validateBackupProperties(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context); - } - - public BackupResult backup() { - return serviceManager.cloudHsmClusters().backup(resourceGroupName, cloudHsmClusterName); - } - - public BackupResult backup(BackupRequestProperties backupRequestProperties, Context context) { - return serviceManager.cloudHsmClusters() - .backup(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context); - } - - public RestoreResult validateRestoreProperties() { - return serviceManager.cloudHsmClusters().validateRestoreProperties(resourceGroupName, cloudHsmClusterName); - } - - public RestoreResult validateRestoreProperties(RestoreRequestProperties restoreRequestProperties, Context context) { - return serviceManager.cloudHsmClusters() - .validateRestoreProperties(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context); - } - - public RestoreResult restore(RestoreRequestProperties restoreRequestProperties) { - return serviceManager.cloudHsmClusters() - .restore(resourceGroupName, cloudHsmClusterName, restoreRequestProperties); - } - - public RestoreResult restore(RestoreRequestProperties restoreRequestProperties, Context context) { - return serviceManager.cloudHsmClusters() - .restore(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context); - } - - public CloudHsmClusterImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public CloudHsmClusterImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public CloudHsmClusterImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateBody.withTags(tags); - return this; - } - } - - public CloudHsmClusterImpl withIdentity(ManagedServiceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateBody.withIdentity(identity); - return this; - } - } - - public CloudHsmClusterImpl withSku(CloudHsmClusterSku sku) { - this.innerModel().withSku(sku); - return this; - } - - public CloudHsmClusterImpl withProperties(CloudHsmClusterProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 07e72e533c46e..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateEndpointConnectionsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * CloudHsmClusterPrivateEndpointConnectionsClient. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsClientImpl - implements CloudHsmClusterPrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final CloudHsmClusterPrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of CloudHsmClusterPrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CloudHsmClusterPrivateEndpointConnectionsClientImpl(AzureHsmResourceProviderImpl client) { - this.service = RestProxy.create(CloudHsmClusterPrivateEndpointConnectionsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderCloudHsmClusterPrivateEndpointConnections to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface CloudHsmClusterPrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @PathParam("peConnectionName") String peConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @PathParam("peConnectionName") String peConnectionName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @PathParam("peConnectionName") String peConnectionName, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName, PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, properties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName, PrivateEndpointConnectionInner properties, - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, properties, accept, context); - } - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, PrivateEndpointConnectionInner properties) { - return createWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, properties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName, PrivateEndpointConnectionInner properties, - Context context) { - return createWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, properties, context) - .block(); - } - - /** - * Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param properties Parameters of the PrivateEndpointConnection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner create(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, PrivateEndpointConnectionInner properties) { - return createWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, properties, Context.NONE) - .getValue(); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 cloudHsmClusterName, String peConnectionName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 cloudHsmClusterName, String peConnectionName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName 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, - cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, accept, context); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName) { - return this.beginDeleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName).getSyncPoller(); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, context).getSyncPoller(); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cloudHsmClusterName, String peConnectionName) { - return beginDeleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cloudHsmClusterName, String peConnectionName, - Context context) { - return beginDeleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 cloudHsmClusterName, String peConnectionName) { - deleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName).block(); - } - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 cloudHsmClusterName, String peConnectionName, Context context) { - deleteAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, context).block(); - } - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (peConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), peConnectionName, accept, context); - } - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String cloudHsmClusterName, String peConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, peConnectionName, context).block(); - } - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName) { - return getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, Context.NONE).getValue(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsImpl.java deleted file mode 100644 index 437088e6c8c1a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -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.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateEndpointConnectionsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPrivateEndpointConnections; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; - -public final class CloudHsmClusterPrivateEndpointConnectionsImpl implements CloudHsmClusterPrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClusterPrivateEndpointConnectionsImpl.class); - - private final CloudHsmClusterPrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public CloudHsmClusterPrivateEndpointConnectionsImpl(CloudHsmClusterPrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String cloudHsmClusterName, String peConnectionName) { - this.serviceClient().delete(resourceGroupName, cloudHsmClusterName, peConnectionName); - } - - public void delete(String resourceGroupName, String cloudHsmClusterName, String peConnectionName, Context context) { - this.serviceClient().delete(resourceGroupName, cloudHsmClusterName, peConnectionName, context); - } - - public Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PrivateEndpointConnection get(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName) { - PrivateEndpointConnectionInner inner - = this.serviceClient().get(resourceGroupName, cloudHsmClusterName, peConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PrivateEndpointConnection getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - String peConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (peConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - String peConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (peConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - String peConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (peConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, cloudHsmClusterName, peConnectionName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - String peConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (peConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, cloudHsmClusterName, peConnectionName, context); - } - - private CloudHsmClusterPrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } - - public PrivateEndpointConnectionImpl define(String name) { - return new PrivateEndpointConnectionImpl(name, this.manager()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesClientImpl.java deleted file mode 100644 index 15f561e72f51d..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateLinkResourcesClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterPrivateLinkResourcesClient. - */ -public final class CloudHsmClusterPrivateLinkResourcesClientImpl implements CloudHsmClusterPrivateLinkResourcesClient { - /** - * The proxy service used to perform REST calls. - */ - private final CloudHsmClusterPrivateLinkResourcesService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of CloudHsmClusterPrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CloudHsmClusterPrivateLinkResourcesClientImpl(AzureHsmResourceProviderImpl client) { - this.service = RestProxy.create(CloudHsmClusterPrivateLinkResourcesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderCloudHsmClusterPrivateLinkResources to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface CloudHsmClusterPrivateLinkResourcesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCloudHsmCluster(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCloudHsmClusterNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCloudHsmClusterSinglePageAsync(String resourceGroupName, - String cloudHsmClusterName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByCloudHsmCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCloudHsmClusterSinglePageAsync(String resourceGroupName, - String cloudHsmClusterName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCloudHsmCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCloudHsmClusterAsync(String resourceGroupName, - String cloudHsmClusterName) { - return new PagedFlux<>(() -> listByCloudHsmClusterSinglePageAsync(resourceGroupName, cloudHsmClusterName), - nextLink -> listByCloudHsmClusterNextSinglePageAsync(nextLink)); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCloudHsmClusterAsync(String resourceGroupName, - String cloudHsmClusterName, Context context) { - return new PagedFlux<>( - () -> listByCloudHsmClusterSinglePageAsync(resourceGroupName, cloudHsmClusterName, context), - nextLink -> listByCloudHsmClusterNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName) { - return new PagedIterable<>(listByCloudHsmClusterAsync(resourceGroupName, cloudHsmClusterName)); - } - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName, Context context) { - return new PagedIterable<>(listByCloudHsmClusterAsync(resourceGroupName, cloudHsmClusterName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCloudHsmClusterNextSinglePageAsync(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.listByCloudHsmClusterNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCloudHsmClusterNextSinglePageAsync(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.listByCloudHsmClusterNext(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/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesImpl.java deleted file mode 100644 index 08f47c3b661cd..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterPrivateLinkResourcesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterPrivateLinkResourcesClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPrivateLinkResources; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResource; - -public final class CloudHsmClusterPrivateLinkResourcesImpl implements CloudHsmClusterPrivateLinkResources { - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClusterPrivateLinkResourcesImpl.class); - - private final CloudHsmClusterPrivateLinkResourcesClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public CloudHsmClusterPrivateLinkResourcesImpl(CloudHsmClusterPrivateLinkResourcesClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName) { - PagedIterable inner - = this.serviceClient().listByCloudHsmCluster(resourceGroupName, cloudHsmClusterName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName, Context context) { - PagedIterable inner - = this.serviceClient().listByCloudHsmCluster(resourceGroupName, cloudHsmClusterName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - private CloudHsmClusterPrivateLinkResourcesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusClientImpl.java deleted file mode 100644 index 3b6d9806bc56a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusClientImpl.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClusterRestoreStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterRestoreStatusGetResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClusterRestoreStatusClient. - */ -public final class CloudHsmClusterRestoreStatusClientImpl implements CloudHsmClusterRestoreStatusClient { - /** - * The proxy service used to perform REST calls. - */ - private final CloudHsmClusterRestoreStatusService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of CloudHsmClusterRestoreStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CloudHsmClusterRestoreStatusClientImpl(AzureHsmResourceProviderImpl client) { - this.service = RestProxy.create(CloudHsmClusterRestoreStatusService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderCloudHsmClusterRestoreStatus to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface CloudHsmClusterRestoreStatusService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String jobId) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (jobId == null) { - return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), jobId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, String jobId, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (jobId == null) { - return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), jobId, accept, context); - } - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String cloudHsmClusterName, String jobId) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, jobId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterRestoreStatusGetResponse getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String jobId, Context context) { - return getWithResponseAsync(resourceGroupName, cloudHsmClusterName, jobId, context).block(); - } - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreResultInner get(String resourceGroupName, String cloudHsmClusterName, String jobId) { - return getWithResponse(resourceGroupName, cloudHsmClusterName, jobId, Context.NONE).getValue(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusImpl.java deleted file mode 100644 index 681b37cce34b3..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClusterRestoreStatusImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -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.hardwaresecuritymodules.fluent.CloudHsmClusterRestoreStatusClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterRestoreStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterRestoreStatusGetResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreResult; - -public final class CloudHsmClusterRestoreStatusImpl implements CloudHsmClusterRestoreStatus { - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClusterRestoreStatusImpl.class); - - private final CloudHsmClusterRestoreStatusClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public CloudHsmClusterRestoreStatusImpl(CloudHsmClusterRestoreStatusClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, String jobId, - Context context) { - CloudHsmClusterRestoreStatusGetResponse inner - = this.serviceClient().getWithResponse(resourceGroupName, cloudHsmClusterName, jobId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RestoreResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RestoreResult get(String resourceGroupName, String cloudHsmClusterName, String jobId) { - RestoreResultInner inner = this.serviceClient().get(resourceGroupName, cloudHsmClusterName, jobId); - if (inner != null) { - return new RestoreResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private CloudHsmClusterRestoreStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersClientImpl.java deleted file mode 100644 index 7aa88deffc13a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersClientImpl.java +++ /dev/null @@ -1,2542 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.CloudHsmClustersClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterListResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPatchParameters; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CloudHsmClustersClient. - */ -public final class CloudHsmClustersClientImpl implements CloudHsmClustersClient { - /** - * The proxy service used to perform REST calls. - */ - private final CloudHsmClustersService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of CloudHsmClustersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CloudHsmClustersClientImpl(AzureHsmResourceProviderImpl client) { - this.service - = RestProxy.create(CloudHsmClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderCloudHsmClusters to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface CloudHsmClustersService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CloudHsmClusterInner body, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CloudHsmClusterPatchParameters body, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skiptoken") String skiptoken, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$skiptoken") String skiptoken, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateBackupProperties(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestProperties backupRequestProperties, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> backup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BackupRequestProperties backupRequestProperties, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateRestoreProperties(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestProperties restoreRequestProperties, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restore(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestProperties restoreRequestProperties, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterInner body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), body, accept, context); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudHsmClusterInner> - beginCreateOrUpdateAsync(String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterInner body) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, cloudHsmClusterName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudHsmClusterInner.class, CloudHsmClusterInner.class, this.client.getContext()); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudHsmClusterInner> beginCreateOrUpdateAsync( - String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, cloudHsmClusterName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudHsmClusterInner.class, CloudHsmClusterInner.class, context); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudHsmClusterInner> - beginCreateOrUpdate(String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterInner body) { - return this.beginCreateOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body).getSyncPoller(); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudHsmClusterInner> beginCreateOrUpdate( - String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterInner body, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body, context).getSyncPoller(); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterInner createOrUpdate(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterInner body) { - return createOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body).block(); - } - - /** - * Create or Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterInner createOrUpdate(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, cloudHsmClusterName, body, context).block(); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), body, accept, context); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudHsmClusterInner> - beginUpdateAsync(String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterPatchParameters body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, cloudHsmClusterName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudHsmClusterInner.class, CloudHsmClusterInner.class, this.client.getContext()); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudHsmClusterInner> beginUpdateAsync( - String resourceGroupName, String cloudHsmClusterName, CloudHsmClusterPatchParameters body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, cloudHsmClusterName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudHsmClusterInner.class, CloudHsmClusterInner.class, context); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudHsmClusterInner> beginUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body) { - return this.beginUpdateAsync(resourceGroupName, cloudHsmClusterName, body).getSyncPoller(); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudHsmClusterInner> beginUpdate(String resourceGroupName, - String cloudHsmClusterName, CloudHsmClusterPatchParameters body, Context context) { - return this.beginUpdateAsync(resourceGroupName, cloudHsmClusterName, body, context).getSyncPoller(); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body) { - return beginUpdateAsync(resourceGroupName, cloudHsmClusterName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body, Context context) { - return beginUpdateAsync(resourceGroupName, cloudHsmClusterName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterInner update(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body) { - return updateAsync(resourceGroupName, cloudHsmClusterName, body).block(); - } - - /** - * Update a Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param body Parameters to create Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterInner update(String resourceGroupName, String cloudHsmClusterName, - CloudHsmClusterPatchParameters body, Context context) { - return updateAsync(resourceGroupName, cloudHsmClusterName, body, context).block(); - } - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName 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, - cloudHsmClusterName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String cloudHsmClusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, cloudHsmClusterName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String cloudHsmClusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, cloudHsmClusterName, context).block(); - } - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudHsmClusterInner getByResourceGroup(String resourceGroupName, String cloudHsmClusterName) { - return getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, Context.NONE).getValue(); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 cloudHsmClusterName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 cloudHsmClusterName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName 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, - cloudHsmClusterName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudHsmClusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudHsmClusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudHsmClusterName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, cloudHsmClusterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName) { - return this.beginDeleteAsync(resourceGroupName, cloudHsmClusterName).getSyncPoller(); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudHsmClusterName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, cloudHsmClusterName, context).getSyncPoller(); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cloudHsmClusterName) { - return beginDeleteAsync(resourceGroupName, cloudHsmClusterName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cloudHsmClusterName, Context context) { - return beginDeleteAsync(resourceGroupName, cloudHsmClusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 cloudHsmClusterName) { - deleteAsync(resourceGroupName, cloudHsmClusterName).block(); - } - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 cloudHsmClusterName, Context context) { - deleteAsync(resourceGroupName, cloudHsmClusterName, context).block(); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String skiptoken) { - 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, skiptoken, 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())); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String skiptoken, 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, - skiptoken, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skiptoken) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String skiptoken = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skiptoken, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String skiptoken = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken, context)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String skiptoken) { - 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(), skiptoken, - 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())); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String skiptoken, 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(), skiptoken, this.client.getApiVersion(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String skiptoken) { - return new PagedFlux<>(() -> listSinglePageAsync(skiptoken), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the 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 list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String skiptoken = null; - return new PagedFlux<>(() -> listSinglePageAsync(skiptoken), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String skiptoken, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(skiptoken, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the 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 list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String skiptoken = null; - return new PagedIterable<>(listAsync(skiptoken)); - } - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String skiptoken, Context context) { - return new PagedIterable<>(listAsync(skiptoken, context)); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateBackupPropertiesWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (backupRequestProperties != null) { - backupRequestProperties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateBackupProperties(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), - backupRequestProperties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateBackupPropertiesWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (backupRequestProperties != null) { - backupRequestProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateBackupProperties(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), backupRequestProperties, accept, - context); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> beginValidateBackupPropertiesAsync( - String resourceGroupName, String cloudHsmClusterName, BackupRequestProperties backupRequestProperties) { - Mono>> mono = validateBackupPropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, backupRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, this.client.getContext()); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> - beginValidateBackupPropertiesAsync(String resourceGroupName, String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - Mono>> mono = validateBackupPropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, backupRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, this.client.getContext()); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> beginValidateBackupPropertiesAsync( - String resourceGroupName, String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = validateBackupPropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, backupRequestProperties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, context); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupResultInner> - beginValidateBackupProperties(String resourceGroupName, String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return this.beginValidateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties) - .getSyncPoller(); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupResultInner> beginValidateBackupProperties( - String resourceGroupName, String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, - Context context) { - return this - .beginValidateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, - context) - .getSyncPoller(); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateBackupPropertiesAsync(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties) { - return beginValidateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateBackupPropertiesAsync(String resourceGroupName, - String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return beginValidateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateBackupPropertiesAsync(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - return beginValidateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResultInner validateBackupProperties(String resourceGroupName, String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return validateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties).block(); - } - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResultInner validateBackupProperties(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - return validateBackupPropertiesAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context) - .block(); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> backupWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (backupRequestProperties != null) { - backupRequestProperties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.backup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), backupRequestProperties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> backupWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (backupRequestProperties != null) { - backupRequestProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.backup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), backupRequestProperties, accept, context); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> beginBackupAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties) { - Mono>> mono - = backupWithResponseAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, this.client.getContext()); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> beginBackupAsync(String resourceGroupName, - String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - Mono>> mono - = backupWithResponseAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, this.client.getContext()); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupResultInner> beginBackupAsync(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = backupWithResponseAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - BackupResultInner.class, BackupResultInner.class, context); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupResultInner> beginBackup(String resourceGroupName, - String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return this.beginBackupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties).getSyncPoller(); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of backup operation Result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupResultInner> beginBackup(String resourceGroupName, - String cloudHsmClusterName, BackupRequestProperties backupRequestProperties, Context context) { - return this.beginBackupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context) - .getSyncPoller(); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono backupAsync(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties) { - return beginBackupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono backupAsync(String resourceGroupName, String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return beginBackupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono backupAsync(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - return beginBackupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResultInner backup(String resourceGroupName, String cloudHsmClusterName) { - final BackupRequestProperties backupRequestProperties = null; - return backupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties).block(); - } - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResultInner backup(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - return backupAsync(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context).block(); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateRestorePropertiesWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (restoreRequestProperties != null) { - restoreRequestProperties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateRestoreProperties(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), - restoreRequestProperties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateRestorePropertiesWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (restoreRequestProperties != null) { - restoreRequestProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateRestoreProperties(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), restoreRequestProperties, accept, - context); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RestoreResultInner> beginValidateRestorePropertiesAsync( - String resourceGroupName, String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - Mono>> mono = validateRestorePropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, restoreRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RestoreResultInner.class, RestoreResultInner.class, this.client.getContext()); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RestoreResultInner> - beginValidateRestorePropertiesAsync(String resourceGroupName, String cloudHsmClusterName) { - final RestoreRequestProperties restoreRequestProperties = null; - Mono>> mono = validateRestorePropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, restoreRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RestoreResultInner.class, RestoreResultInner.class, this.client.getContext()); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RestoreResultInner> beginValidateRestorePropertiesAsync( - String resourceGroupName, String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = validateRestorePropertiesWithResponseAsync(resourceGroupName, - cloudHsmClusterName, restoreRequestProperties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RestoreResultInner.class, RestoreResultInner.class, context); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RestoreResultInner> - beginValidateRestoreProperties(String resourceGroupName, String cloudHsmClusterName) { - final RestoreRequestProperties restoreRequestProperties = null; - return this - .beginValidateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties) - .getSyncPoller(); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RestoreResultInner> beginValidateRestoreProperties( - String resourceGroupName, String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, - Context context) { - return this - .beginValidateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, - context) - .getSyncPoller(); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateRestorePropertiesAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - return beginValidateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateRestorePropertiesAsync(String resourceGroupName, - String cloudHsmClusterName) { - final RestoreRequestProperties restoreRequestProperties = null; - return beginValidateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateRestorePropertiesAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, Context context) { - return beginValidateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreResultInner validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName) { - final RestoreRequestProperties restoreRequestProperties = null; - return validateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties).block(); - } - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreResultInner validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context) { - return validateRestorePropertiesAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context) - .block(); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (restoreRequestProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter restoreRequestProperties is required and cannot be null.")); - } else { - restoreRequestProperties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, this.client.getApiVersion(), restoreRequestProperties, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreWithResponseAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - if (restoreRequestProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter restoreRequestProperties is required and cannot be null.")); - } else { - restoreRequestProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), restoreRequestProperties, accept, context); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RestoreResultInner> beginRestoreAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - Mono>> mono - = restoreWithResponseAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RestoreResultInner.class, RestoreResultInner.class, this.client.getContext()); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RestoreResultInner> beginRestoreAsync(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = restoreWithResponseAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RestoreResultInner.class, RestoreResultInner.class, context); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RestoreResultInner> beginRestore(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties) { - return this.beginRestoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties).getSyncPoller(); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of restore operation properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RestoreResultInner> beginRestore(String resourceGroupName, - String cloudHsmClusterName, RestoreRequestProperties restoreRequestProperties, Context context) { - return this.beginRestoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context) - .getSyncPoller(); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreAsync(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties) { - return beginRestoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreAsync(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context) { - return beginRestoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreResultInner restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties) { - return restoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties).block(); - } - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RestoreResultInner restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context) { - return restoreAsync(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters 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)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersImpl.java deleted file mode 100644 index 5276598e0a70a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/CloudHsmClustersImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.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.hardwaresecuritymodules.fluent.CloudHsmClustersClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusters; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreResult; - -public final class CloudHsmClustersImpl implements CloudHsmClusters { - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClustersImpl.class); - - private final CloudHsmClustersClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public CloudHsmClustersImpl(CloudHsmClustersClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String cloudHsmClusterName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CloudHsmClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CloudHsmCluster getByResourceGroup(String resourceGroupName, String cloudHsmClusterName) { - CloudHsmClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudHsmClusterName); - if (inner != null) { - return new CloudHsmClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String cloudHsmClusterName) { - this.serviceClient().delete(resourceGroupName, cloudHsmClusterName); - } - - public void delete(String resourceGroupName, String cloudHsmClusterName, Context context) { - this.serviceClient().delete(resourceGroupName, cloudHsmClusterName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudHsmClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, skiptoken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudHsmClusterImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudHsmClusterImpl(inner1, this.manager())); - } - - public PagedIterable list(String skiptoken, Context context) { - PagedIterable inner = this.serviceClient().list(skiptoken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudHsmClusterImpl(inner1, this.manager())); - } - - public BackupResult validateBackupProperties(String resourceGroupName, String cloudHsmClusterName) { - BackupResultInner inner = this.serviceClient().validateBackupProperties(resourceGroupName, cloudHsmClusterName); - if (inner != null) { - return new BackupResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public BackupResult validateBackupProperties(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - BackupResultInner inner = this.serviceClient() - .validateBackupProperties(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context); - if (inner != null) { - return new BackupResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public BackupResult backup(String resourceGroupName, String cloudHsmClusterName) { - BackupResultInner inner = this.serviceClient().backup(resourceGroupName, cloudHsmClusterName); - if (inner != null) { - return new BackupResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public BackupResult backup(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context) { - BackupResultInner inner - = this.serviceClient().backup(resourceGroupName, cloudHsmClusterName, backupRequestProperties, context); - if (inner != null) { - return new BackupResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public RestoreResult validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName) { - RestoreResultInner inner - = this.serviceClient().validateRestoreProperties(resourceGroupName, cloudHsmClusterName); - if (inner != null) { - return new RestoreResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public RestoreResult validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context) { - RestoreResultInner inner = this.serviceClient() - .validateRestoreProperties(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context); - if (inner != null) { - return new RestoreResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public RestoreResult restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties) { - RestoreResultInner inner - = this.serviceClient().restore(resourceGroupName, cloudHsmClusterName, restoreRequestProperties); - if (inner != null) { - return new RestoreResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public RestoreResult restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context) { - RestoreResultInner inner - = this.serviceClient().restore(resourceGroupName, cloudHsmClusterName, restoreRequestProperties, context); - if (inner != null) { - return new RestoreResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public CloudHsmCluster getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, cloudHsmClusterName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - this.delete(resourceGroupName, cloudHsmClusterName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String cloudHsmClusterName = ResourceManagerUtils.getValueFromIdByName(id, "cloudHsmClusters"); - if (cloudHsmClusterName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'cloudHsmClusters'.", id))); - } - this.delete(resourceGroupName, cloudHsmClusterName, context); - } - - private CloudHsmClustersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } - - public CloudHsmClusterImpl define(String name) { - return new CloudHsmClusterImpl(name, this.manager()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmImpl.java index 20faa3a503297..1faabcd391b24 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmImpl.java @@ -59,14 +59,14 @@ public List zones() { } } - public DedicatedHsmProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public DedicatedHsmProperties properties() { + return this.innerModel().properties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -172,11 +172,6 @@ public DedicatedHsmImpl withRegion(String location) { return this; } - public DedicatedHsmImpl withSku(Sku sku) { - this.innerModel().withSku(sku); - return this; - } - public DedicatedHsmImpl withProperties(DedicatedHsmProperties properties) { this.innerModel().withProperties(properties); return this; @@ -192,6 +187,11 @@ public DedicatedHsmImpl withTags(Map tags) { } } + public DedicatedHsmImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + public DedicatedHsmImpl withZones(List zones) { this.innerModel().withZones(zones); return this; diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmOperationImpl.java similarity index 68% rename from sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationImpl.java rename to sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmOperationImpl.java index 7c7a85143b9d2..93cc49a44ac53 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmOperationImpl.java @@ -4,18 +4,16 @@ package com.azure.resourcemanager.hardwaresecuritymodules.implementation; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ActionType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.Operation; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationDisplay; -import com.azure.resourcemanager.hardwaresecuritymodules.models.Origin; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperation; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay; -public final class OperationImpl implements Operation { - private OperationInner innerObject; +public final class DedicatedHsmOperationImpl implements DedicatedHsmOperation { + private DedicatedHsmOperationInner innerObject; private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - OperationImpl(OperationInner innerObject, + DedicatedHsmOperationImpl(DedicatedHsmOperationInner innerObject, com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -29,19 +27,15 @@ public Boolean isDataAction() { return this.innerModel().isDataAction(); } - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { + public String origin() { return this.innerModel().origin(); } - public ActionType actionType() { - return this.innerModel().actionType(); + public DedicatedHsmOperationDisplay display() { + return this.innerModel().display(); } - public OperationInner innerModel() { + public DedicatedHsmOperationInner innerModel() { return this.innerObject; } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmsClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmsClientImpl.java index 08005104f453a..7e882424a846a 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmsClientImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/DedicatedHsmsClientImpl.java @@ -86,7 +86,7 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}") - @ExpectedResponses({ 200, 202 }) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @@ -96,7 +96,7 @@ Mono>> update(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}") - @ExpectedResponses({ 202, 204 }) + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono>> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @@ -166,7 +166,7 @@ Mono> listOutboundNetworkDepende /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -208,7 +208,7 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -250,7 +250,7 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -269,7 +269,7 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -291,7 +291,7 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -308,7 +308,7 @@ public SyncPoller, DedicatedHsmInner> beginCreateO /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -326,7 +326,7 @@ public SyncPoller, DedicatedHsmInner> beginCreateO /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -344,7 +344,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, St /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -363,7 +363,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, St /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -379,7 +379,7 @@ public DedicatedHsmInner createOrUpdate(String resourceGroupName, String name, D /** * Create or Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @param name Name of the dedicated Hsm. * @param parameters Parameters to create or update the dedicated hsm. * @param context The context to associate with this operation. @@ -397,8 +397,8 @@ public DedicatedHsmInner createOrUpdate(String resourceGroupName, String name, D /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -439,8 +439,8 @@ private Mono>> updateWithResponseAsync(String resource /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -481,8 +481,8 @@ private Mono>> updateWithResponseAsync(String resource /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -500,8 +500,8 @@ private PollerFlux, DedicatedHsmInner> beginUpdate /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,8 +521,8 @@ private PollerFlux, DedicatedHsmInner> beginUpdate /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -538,8 +538,8 @@ public SyncPoller, DedicatedHsmInner> beginUpdate( /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -556,8 +556,8 @@ public SyncPoller, DedicatedHsmInner> beginUpdate( /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -574,8 +574,8 @@ private Mono updateAsync(String resourceGroupName, String nam /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -593,8 +593,8 @@ private Mono updateAsync(String resourceGroupName, String nam /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -609,8 +609,8 @@ public DedicatedHsmInner update(String resourceGroupName, String name, Dedicated /** * Update a dedicated HSM in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param name Name of the dedicated HSM. * @param parameters Parameters to patch the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -627,8 +627,8 @@ public DedicatedHsmInner update(String resourceGroupName, String name, Dedicated /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -661,8 +661,8 @@ private Mono>> deleteWithResponseAsync(String resource /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -696,8 +696,8 @@ private Mono>> deleteWithResponseAsync(String resource /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -713,8 +713,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -733,8 +733,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -748,8 +748,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -764,8 +764,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -779,8 +779,8 @@ private Mono deleteAsync(String resourceGroupName, String name) { /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -795,8 +795,8 @@ private Mono deleteAsync(String resourceGroupName, String name, Context co /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -809,8 +809,8 @@ public void delete(String resourceGroupName, String name) { /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -824,8 +824,8 @@ public void delete(String resourceGroupName, String name, Context context) { /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -859,8 +859,8 @@ private Mono> getByResourceGroupWithResponseAsync(St /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -894,8 +894,8 @@ private Mono> getByResourceGroupWithResponseAsync(St /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -910,8 +910,8 @@ private Mono getByResourceGroupAsync(String resourceGroupName /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -927,8 +927,8 @@ public Response getByResourceGroupWithResponse(String resourc /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -943,7 +943,7 @@ public DedicatedHsmInner getByResourceGroup(String resourceGroupName, String nam * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -978,7 +978,7 @@ private Mono> listByResourceGroupSinglePageAsyn * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1014,7 +1014,7 @@ private Mono> listByResourceGroupSinglePageAsyn * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1031,7 +1031,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1048,7 +1048,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1067,7 +1067,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1083,7 +1083,7 @@ public PagedIterable listByResourceGroup(String resourceGroup * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1234,8 +1234,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1276,8 +1276,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1320,8 +1320,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1342,8 +1342,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1366,8 +1366,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1387,8 +1387,8 @@ public PagedIterable list(Integer top, Context context) { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsClientImpl.java index ee96b422e7dc7..72bc25eff9369 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsClientImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsClientImpl.java @@ -21,12 +21,12 @@ 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.hardwaresecuritymodules.fluent.OperationsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationListResult; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationListResult; +import com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException; import reactor.core.publisher.Mono; /** @@ -64,21 +64,21 @@ public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.HardwareSecurityModules/operations") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of Dedicated HSM operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -87,23 +87,23 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of Dedicated HSM operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -116,54 +116,54 @@ private Mono> listSinglePageAsync(Context context) } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedFlux}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync()); } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedFlux}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>(() -> listSinglePageAsync(context)); } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsImpl.java index a14942ebe73ba..341b97a24c31b 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsImpl.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/OperationsImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hardwaresecuritymodules.fluent.OperationsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.Operation; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperation; import com.azure.resourcemanager.hardwaresecuritymodules.models.Operations; public final class OperationsImpl implements Operations { @@ -25,14 +25,14 @@ public OperationsImpl(OperationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DedicatedHsmOperationImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DedicatedHsmOperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionImpl.java deleted file mode 100644 index 83d1c731e84a8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; - -public final class PrivateEndpointConnectionImpl - implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { - private PrivateEndpointConnectionInner innerObject; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateEndpointConnectionProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public PrivateEndpointConnectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String cloudHsmClusterName; - - private String peConnectionName; - - public PrivateEndpointConnectionImpl withExistingCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName) { - this.resourceGroupName = resourceGroupName; - this.cloudHsmClusterName = cloudHsmClusterName; - return this; - } - - public PrivateEndpointConnection create() { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusterPrivateEndpointConnections() - .createWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnection create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusterPrivateEndpointConnections() - .createWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, this.innerModel(), context) - .getValue(); - return this; - } - - PrivateEndpointConnectionImpl(String name, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = new PrivateEndpointConnectionInner(); - this.serviceManager = serviceManager; - this.peConnectionName = name; - } - - public PrivateEndpointConnection refresh() { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusterPrivateEndpointConnections() - .getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnection refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCloudHsmClusterPrivateEndpointConnections() - .getWithResponse(resourceGroupName, cloudHsmClusterName, peConnectionName, context) - .getValue(); - return this; - } - - public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public PrivateEndpointConnectionImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 5267107b7dc61..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final AzureHsmResourceProviderImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(AzureHsmResourceProviderImpl client) { - this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureHsmResourceProviderPrivateEndpointConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureHsmResourceProv") - public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCloudHsmCluster(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudHsmClusterName") String cloudHsmClusterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCloudHsmClusterNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByCloudHsmClusterSinglePageAsync(String resourceGroupName, String cloudHsmClusterName) { - 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByCloudHsmCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, cloudHsmClusterName, 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())); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByCloudHsmClusterSinglePageAsync(String resourceGroupName, String cloudHsmClusterName, 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 (cloudHsmClusterName == null) { - return Mono - .error(new IllegalArgumentException("Parameter cloudHsmClusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCloudHsmCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - cloudHsmClusterName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCloudHsmClusterAsync(String resourceGroupName, - String cloudHsmClusterName) { - return new PagedFlux<>(() -> listByCloudHsmClusterSinglePageAsync(resourceGroupName, cloudHsmClusterName), - nextLink -> listByCloudHsmClusterNextSinglePageAsync(nextLink)); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCloudHsmClusterAsync(String resourceGroupName, - String cloudHsmClusterName, Context context) { - return new PagedFlux<>( - () -> listByCloudHsmClusterSinglePageAsync(resourceGroupName, cloudHsmClusterName, context), - nextLink -> listByCloudHsmClusterNextSinglePageAsync(nextLink, context)); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName) { - return new PagedIterable<>(listByCloudHsmClusterAsync(resourceGroupName, cloudHsmClusterName)); - } - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName, Context context) { - return new PagedIterable<>(listByCloudHsmClusterAsync(resourceGroupName, cloudHsmClusterName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByCloudHsmClusterNextSinglePageAsync(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.listByCloudHsmClusterNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByCloudHsmClusterNextSinglePageAsync(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.listByCloudHsmClusterNext(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/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index e344897dd68f8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnections; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName) { - PagedIterable inner - = this.serviceClient().listByCloudHsmCluster(resourceGroupName, cloudHsmClusterName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName, Context context) { - PagedIterable inner - = this.serviceClient().listByCloudHsmCluster(resourceGroupName, cloudHsmClusterName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateLinkResourceImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateLinkResourceImpl.java deleted file mode 100644 index 272a7876a25d2..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/PrivateLinkResourceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResource; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourceImpl implements PrivateLinkResource { - private PrivateLinkResourceInner innerObject; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateLinkResourceProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public PrivateLinkResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/RestoreResultImpl.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/RestoreResultImpl.java deleted file mode 100644 index 180a3f80a2c96..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/implementation/RestoreResultImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.implementation; - -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRestoreBaseResultProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreResult; - -public final class RestoreResultImpl implements RestoreResult { - private RestoreResultInner innerObject; - - private final com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager; - - RestoreResultImpl(RestoreResultInner innerObject, - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public BackupRestoreBaseResultProperties properties() { - return this.innerModel().properties(); - } - - public RestoreResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActionType.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActionType.java deleted file mode 100644 index a8d7ba8cef9ae..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActionType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * Static value Internal for ActionType. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActivationState.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActivationState.java deleted file mode 100644 index e28686e469ce5..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ActivationState.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * State of security domain activation. - */ -public final class ActivationState extends ExpandableStringEnum { - /** - * Static value NotDefined for ActivationState. - */ - public static final ActivationState NOT_DEFINED = fromString("NotDefined"); - - /** - * Static value NotActivated for ActivationState. - */ - public static final ActivationState NOT_ACTIVATED = fromString("NotActivated"); - - /** - * Static value Active for ActivationState. - */ - public static final ActivationState ACTIVE = fromString("Active"); - - /** - * Static value Failed for ActivationState. - */ - public static final ActivationState FAILED = fromString("Failed"); - - /** - * Static value Unknown for ActivationState. - */ - public static final ActivationState UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of ActivationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActivationState() { - } - - /** - * Creates or finds a ActivationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActivationState. - */ - public static ActivationState fromString(String name) { - return fromString(name, ActivationState.class); - } - - /** - * Gets known ActivationState values. - * - * @return known ActivationState values. - */ - public static Collection values() { - return values(ActivationState.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ApiEntityReference.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ApiEntityReference.java index 4c54aef196def..24d8d8ce3cb1f 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ApiEntityReference.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ApiEntityReference.java @@ -17,9 +17,9 @@ @Fluent public final class ApiEntityReference implements JsonSerializable { /* - * The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ - private String resourceId; + private String id; /** * Creates an instance of ApiEntityReference class. @@ -28,24 +28,24 @@ public ApiEntityReference() { } /** - * Get the resourceId property: The Azure resource id in the form of + * Get the id property: The ARM resource id in the form of * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... * - * @return the resourceId value. + * @return the id value. */ - public String resourceId() { - return this.resourceId; + public String id() { + return this.id; } /** - * Set the resourceId property: The Azure resource id in the form of + * Set the id property: The ARM resource id in the form of * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... * - * @param resourceId the resourceId value to set. + * @param id the id value to set. * @return the ApiEntityReference object itself. */ - public ApiEntityReference withResourceId(String resourceId) { - this.resourceId = resourceId; + public ApiEntityReference withId(String id) { + this.id = id; return this; } @@ -63,7 +63,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("id", this.id); return jsonWriter.writeEndObject(); } @@ -82,8 +82,8 @@ public static ApiEntityReference fromJson(JsonReader jsonReader) throws IOExcept String fieldName = reader.getFieldName(); reader.nextToken(); - if ("resourceId".equals(fieldName)) { - deserializedApiEntityReference.resourceId = reader.getString(); + if ("id".equals(fieldName)) { + deserializedApiEntityReference.id = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/AutoGeneratedDomainNameLabelScope.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/AutoGeneratedDomainNameLabelScope.java deleted file mode 100644 index 5e48ab3222a81..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/AutoGeneratedDomainNameLabelScope.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The Cloud HSM Cluster's auto-generated Domain Name Label Scope. - */ -public final class AutoGeneratedDomainNameLabelScope extends ExpandableStringEnum { - /** - * Static value TenantReuse for AutoGeneratedDomainNameLabelScope. - */ - public static final AutoGeneratedDomainNameLabelScope TENANT_REUSE = fromString("TenantReuse"); - - /** - * Static value SubscriptionReuse for AutoGeneratedDomainNameLabelScope. - */ - public static final AutoGeneratedDomainNameLabelScope SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); - - /** - * Static value ResourceGroupReuse for AutoGeneratedDomainNameLabelScope. - */ - public static final AutoGeneratedDomainNameLabelScope RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); - - /** - * Static value NoReuse for AutoGeneratedDomainNameLabelScope. - */ - public static final AutoGeneratedDomainNameLabelScope NO_REUSE = fromString("NoReuse"); - - /** - * Creates a new instance of AutoGeneratedDomainNameLabelScope value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoGeneratedDomainNameLabelScope() { - } - - /** - * Creates or finds a AutoGeneratedDomainNameLabelScope from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoGeneratedDomainNameLabelScope. - */ - public static AutoGeneratedDomainNameLabelScope fromString(String name) { - return fromString(name, AutoGeneratedDomainNameLabelScope.class); - } - - /** - * Gets known AutoGeneratedDomainNameLabelScope values. - * - * @return known AutoGeneratedDomainNameLabelScope values. - */ - public static Collection values() { - return values(AutoGeneratedDomainNameLabelScope.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRequestProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRequestProperties.java deleted file mode 100644 index 29df907a194e0..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRequestProperties.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Backup properties. - */ -@Fluent -public final class BackupRequestProperties extends BackupRestoreRequestBaseProperties { - /** - * Creates an instance of BackupRequestProperties class. - */ - public BackupRequestProperties() { - } - - /** - * {@inheritDoc} - */ - @Override - public BackupRequestProperties withAzureStorageBlobContainerUri(String azureStorageBlobContainerUri) { - super.withAzureStorageBlobContainerUri(azureStorageBlobContainerUri); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupRequestProperties withToken(String token) { - super.withToken(token); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (azureStorageBlobContainerUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property azureStorageBlobContainerUri in model BackupRequestProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupRequestProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("azureStorageBlobContainerUri", azureStorageBlobContainerUri()); - jsonWriter.writeStringField("token", token()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRequestProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupRequestProperties. - */ - public static BackupRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRequestProperties deserializedBackupRequestProperties = new BackupRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureStorageBlobContainerUri".equals(fieldName)) { - deserializedBackupRequestProperties.withAzureStorageBlobContainerUri(reader.getString()); - } else if ("token".equals(fieldName)) { - deserializedBackupRequestProperties.withToken(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRequestProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreBaseResultProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreBaseResultProperties.java deleted file mode 100644 index 201401d5de782..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreBaseResultProperties.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Backup and Restore operation common properties. - */ -@Fluent -public class BackupRestoreBaseResultProperties implements JsonSerializable { - /* - * Status of the backup/restore operation - */ - private BackupRestoreOperationStatus status; - - /* - * The status details of backup/restore operation - */ - private String statusDetails; - - /* - * Error encountered, if any, during the backup/restore operation. - */ - private ManagementError error; - - /* - * The start time of the backup/restore operation in UTC - */ - private OffsetDateTime startTime; - - /* - * The end time of the backup/restore operation in UTC - */ - private OffsetDateTime endTime; - - /* - * Identifier for the backup/restore operation. - */ - private String jobId; - - /** - * Creates an instance of BackupRestoreBaseResultProperties class. - */ - public BackupRestoreBaseResultProperties() { - } - - /** - * Get the status property: Status of the backup/restore operation. - * - * @return the status value. - */ - public BackupRestoreOperationStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the backup/restore operation. - * - * @param status the status value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - BackupRestoreBaseResultProperties withStatus(BackupRestoreOperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the statusDetails property: The status details of backup/restore operation. - * - * @return the statusDetails value. - */ - public String statusDetails() { - return this.statusDetails; - } - - /** - * Set the statusDetails property: The status details of backup/restore operation. - * - * @param statusDetails the statusDetails value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - public BackupRestoreBaseResultProperties withStatusDetails(String statusDetails) { - this.statusDetails = statusDetails; - return this; - } - - /** - * Get the error property: Error encountered, if any, during the backup/restore operation. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: Error encountered, if any, during the backup/restore operation. - * - * @param error the error value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - public BackupRestoreBaseResultProperties withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Get the startTime property: The start time of the backup/restore operation in UTC. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the backup/restore operation in UTC. - * - * @param startTime the startTime value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - BackupRestoreBaseResultProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the backup/restore operation in UTC. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the backup/restore operation in UTC. - * - * @param endTime the endTime value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - BackupRestoreBaseResultProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the jobId property: Identifier for the backup/restore operation. - * - * @return the jobId value. - */ - public String jobId() { - return this.jobId; - } - - /** - * Set the jobId property: Identifier for the backup/restore operation. - * - * @param jobId the jobId value to set. - * @return the BackupRestoreBaseResultProperties object itself. - */ - public BackupRestoreBaseResultProperties withJobId(String jobId) { - this.jobId = jobId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("statusDetails", this.statusDetails); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeStringField("jobId", this.jobId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRestoreBaseResultProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRestoreBaseResultProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupRestoreBaseResultProperties. - */ - public static BackupRestoreBaseResultProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRestoreBaseResultProperties deserializedBackupRestoreBaseResultProperties - = new BackupRestoreBaseResultProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.status - = BackupRestoreOperationStatus.fromString(reader.getString()); - } else if ("statusDetails".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.statusDetails = reader.getString(); - } else if ("error".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.error = ManagementError.fromJson(reader); - } else if ("startTime".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("jobId".equals(fieldName)) { - deserializedBackupRestoreBaseResultProperties.jobId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRestoreBaseResultProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreOperationStatus.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreOperationStatus.java deleted file mode 100644 index e6d7a409c9cf4..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreOperationStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Status of the backup/restore operation. - */ -public final class BackupRestoreOperationStatus extends ExpandableStringEnum { - /** - * Static value InProgress for BackupRestoreOperationStatus. - */ - public static final BackupRestoreOperationStatus IN_PROGRESS = fromString("InProgress"); - - /** - * Static value Succeeded for BackupRestoreOperationStatus. - */ - public static final BackupRestoreOperationStatus SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for BackupRestoreOperationStatus. - */ - public static final BackupRestoreOperationStatus FAILED = fromString("Failed"); - - /** - * Static value Cancelled for BackupRestoreOperationStatus. - */ - public static final BackupRestoreOperationStatus CANCELLED = fromString("Cancelled"); - - /** - * Creates a new instance of BackupRestoreOperationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupRestoreOperationStatus() { - } - - /** - * Creates or finds a BackupRestoreOperationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupRestoreOperationStatus. - */ - public static BackupRestoreOperationStatus fromString(String name) { - return fromString(name, BackupRestoreOperationStatus.class); - } - - /** - * Gets known BackupRestoreOperationStatus values. - * - * @return known BackupRestoreOperationStatus values. - */ - public static Collection values() { - return values(BackupRestoreOperationStatus.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreRequestBaseProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreRequestBaseProperties.java deleted file mode 100644 index 552435a9719a9..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupRestoreRequestBaseProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Backup and Restore Common properties. - */ -@Fluent -public class BackupRestoreRequestBaseProperties implements JsonSerializable { - /* - * The Azure blob storage container Uri which contains the backup - */ - private String azureStorageBlobContainerUri; - - /* - * The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. - */ - private String token; - - /** - * Creates an instance of BackupRestoreRequestBaseProperties class. - */ - public BackupRestoreRequestBaseProperties() { - } - - /** - * Get the azureStorageBlobContainerUri property: The Azure blob storage container Uri which contains the backup. - * - * @return the azureStorageBlobContainerUri value. - */ - public String azureStorageBlobContainerUri() { - return this.azureStorageBlobContainerUri; - } - - /** - * Set the azureStorageBlobContainerUri property: The Azure blob storage container Uri which contains the backup. - * - * @param azureStorageBlobContainerUri the azureStorageBlobContainerUri value to set. - * @return the BackupRestoreRequestBaseProperties object itself. - */ - public BackupRestoreRequestBaseProperties withAzureStorageBlobContainerUri(String azureStorageBlobContainerUri) { - this.azureStorageBlobContainerUri = azureStorageBlobContainerUri; - return this; - } - - /** - * Get the token property: The SAS token pointing to an Azure blob storage container. This property is reserved for - * Azure Backup Service. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Set the token property: The SAS token pointing to an Azure blob storage container. This property is reserved for - * Azure Backup Service. - * - * @param token the token value to set. - * @return the BackupRestoreRequestBaseProperties object itself. - */ - public BackupRestoreRequestBaseProperties withToken(String token) { - this.token = token; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureStorageBlobContainerUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property azureStorageBlobContainerUri in model BackupRestoreRequestBaseProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupRestoreRequestBaseProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("azureStorageBlobContainerUri", this.azureStorageBlobContainerUri); - jsonWriter.writeStringField("token", this.token); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRestoreRequestBaseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRestoreRequestBaseProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupRestoreRequestBaseProperties. - */ - public static BackupRestoreRequestBaseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRestoreRequestBaseProperties deserializedBackupRestoreRequestBaseProperties - = new BackupRestoreRequestBaseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureStorageBlobContainerUri".equals(fieldName)) { - deserializedBackupRestoreRequestBaseProperties.azureStorageBlobContainerUri = reader.getString(); - } else if ("token".equals(fieldName)) { - deserializedBackupRestoreRequestBaseProperties.token = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRestoreRequestBaseProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResult.java deleted file mode 100644 index 306e293fa0d4b..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResult.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.hardwaresecuritymodules.models; - -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; - -/** - * An immutable client-side representation of BackupResult. - */ -public interface BackupResult { - /** - * Gets the properties property: Properties of the Cloud HSM Cluster. - * - * @return the properties value. - */ - BackupResultProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner object. - * - * @return the inner object. - */ - BackupResultInner innerModel(); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResultProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResultProperties.java deleted file mode 100644 index b22ff69bb30a8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/BackupResultProperties.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Properties of the Cloud HSM Cluster. - */ -@Fluent -public final class BackupResultProperties extends BackupRestoreBaseResultProperties { - /* - * The Azure blob storage container Uri which contains the backup - */ - private String azureStorageBlobContainerUri; - - /* - * The ID of the backup. - */ - private String backupId; - - /* - * The end time of the backup/restore operation in UTC - */ - private OffsetDateTime endTime; - - /* - * The start time of the backup/restore operation in UTC - */ - private OffsetDateTime startTime; - - /* - * Status of the backup/restore operation - */ - private BackupRestoreOperationStatus status; - - /** - * Creates an instance of BackupResultProperties class. - */ - public BackupResultProperties() { - } - - /** - * Get the azureStorageBlobContainerUri property: The Azure blob storage container Uri which contains the backup. - * - * @return the azureStorageBlobContainerUri value. - */ - public String azureStorageBlobContainerUri() { - return this.azureStorageBlobContainerUri; - } - - /** - * Set the azureStorageBlobContainerUri property: The Azure blob storage container Uri which contains the backup. - * - * @param azureStorageBlobContainerUri the azureStorageBlobContainerUri value to set. - * @return the BackupResultProperties object itself. - */ - public BackupResultProperties withAzureStorageBlobContainerUri(String azureStorageBlobContainerUri) { - this.azureStorageBlobContainerUri = azureStorageBlobContainerUri; - return this; - } - - /** - * Get the backupId property: The ID of the backup. - * - * @return the backupId value. - */ - public String backupId() { - return this.backupId; - } - - /** - * Set the backupId property: The ID of the backup. - * - * @param backupId the backupId value to set. - * @return the BackupResultProperties object itself. - */ - public BackupResultProperties withBackupId(String backupId) { - this.backupId = backupId; - return this; - } - - /** - * Get the endTime property: The end time of the backup/restore operation in UTC. - * - * @return the endTime value. - */ - @Override - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the startTime property: The start time of the backup/restore operation in UTC. - * - * @return the startTime value. - */ - @Override - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the status property: Status of the backup/restore operation. - * - * @return the status value. - */ - @Override - public BackupRestoreOperationStatus status() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupResultProperties withStatusDetails(String statusDetails) { - super.withStatusDetails(statusDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupResultProperties withError(ManagementError error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupResultProperties withJobId(String jobId) { - super.withJobId(jobId); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("statusDetails", statusDetails()); - jsonWriter.writeJsonField("error", error()); - jsonWriter.writeStringField("jobId", jobId()); - jsonWriter.writeStringField("azureStorageBlobContainerUri", this.azureStorageBlobContainerUri); - jsonWriter.writeStringField("backupId", this.backupId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResultProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResultProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupResultProperties. - */ - public static BackupResultProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResultProperties deserializedBackupResultProperties = new BackupResultProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedBackupResultProperties.status - = BackupRestoreOperationStatus.fromString(reader.getString()); - } else if ("statusDetails".equals(fieldName)) { - deserializedBackupResultProperties.withStatusDetails(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedBackupResultProperties.withError(ManagementError.fromJson(reader)); - } else if ("startTime".equals(fieldName)) { - deserializedBackupResultProperties.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedBackupResultProperties.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("jobId".equals(fieldName)) { - deserializedBackupResultProperties.withJobId(reader.getString()); - } else if ("azureStorageBlobContainerUri".equals(fieldName)) { - deserializedBackupResultProperties.azureStorageBlobContainerUri = reader.getString(); - } else if ("backupId".equals(fieldName)) { - deserializedBackupResultProperties.backupId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResultProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmCluster.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmCluster.java deleted file mode 100644 index f6a0b06caf1e1..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmCluster.java +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import java.util.Map; - -/** - * An immutable client-side representation of CloudHsmCluster. - */ -public interface CloudHsmCluster { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). - * - * @return the identity value. - */ - ManagedServiceIdentity identity(); - - /** - * Gets the sku property: SKU details. - * - * @return the sku value. - */ - CloudHsmClusterSku sku(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the properties property: Properties of the Cloud HSM Cluster. - * - * @return the properties value. - */ - CloudHsmClusterProperties properties(); - - /** - * 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.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner object. - * - * @return the inner object. - */ - CloudHsmClusterInner innerModel(); - - /** - * The entirety of the CloudHsmCluster definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The CloudHsmCluster definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CloudHsmCluster definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the CloudHsmCluster 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 CloudHsmCluster definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the CloudHsmCluster 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.WithSku, - DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - CloudHsmCluster create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CloudHsmCluster create(Context context); - } - - /** - * The stage of the CloudHsmCluster 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 CloudHsmCluster definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Managed service identity (system assigned and/or user assigned - * identities). - * - * @param identity Managed service identity (system assigned and/or user assigned identities). - * @return the next definition stage. - */ - WithCreate withIdentity(ManagedServiceIdentity identity); - } - - /** - * The stage of the CloudHsmCluster definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: SKU details. - * - * @param sku SKU details. - * @return the next definition stage. - */ - WithCreate withSku(CloudHsmClusterSku sku); - } - - /** - * The stage of the CloudHsmCluster definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the Cloud HSM Cluster. - * - * @param properties Properties of the Cloud HSM Cluster. - * @return the next definition stage. - */ - WithCreate withProperties(CloudHsmClusterProperties properties); - } - } - - /** - * Begins update for the CloudHsmCluster resource. - * - * @return the stage of resource update. - */ - CloudHsmCluster.Update update(); - - /** - * The template for CloudHsmCluster update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CloudHsmCluster apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CloudHsmCluster apply(Context context); - } - - /** - * The CloudHsmCluster update stages. - */ - interface UpdateStages { - /** - * The stage of the CloudHsmCluster update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: The Cloud HSM Cluster's tags. - * - * @param tags The Cloud HSM Cluster's tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the CloudHsmCluster update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Managed service identity (system assigned and/or user assigned - * identities). - * - * @param identity Managed service identity (system assigned and/or user assigned identities). - * @return the next definition stage. - */ - Update withIdentity(ManagedServiceIdentity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CloudHsmCluster refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CloudHsmCluster refresh(Context context); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified 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 backup operation Result. - */ - BackupResult validateBackupProperties(); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult validateBackupProperties(BackupRequestProperties backupRequestProperties, Context context); - - /** - * Create a backup of the Cloud HSM Cluster in the specified 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 backup operation Result. - */ - BackupResult backup(); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult backup(BackupRequestProperties backupRequestProperties, Context context); - - /** - * Queued validating pre restore operation. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult validateRestoreProperties(); - - /** - * Queued validating pre restore operation. - * - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult validateRestoreProperties(RestoreRequestProperties restoreRequestProperties, Context context); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult restore(RestoreRequestProperties restoreRequestProperties); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult restore(RestoreRequestProperties restoreRequestProperties, Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatus.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatus.java deleted file mode 100644 index 3ef8e5b791baf..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatus.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.hardwaresecuritymodules.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of CloudHsmClusterBackupStatus. - */ -public interface CloudHsmClusterBackupStatus { - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, String jobId, - Context context); - - /** - * Gets the backup operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the backup operation status of the specified Cloud HSM Cluster. - */ - BackupResult get(String resourceGroupName, String cloudHsmClusterName, String jobId); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetHeaders.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetHeaders.java deleted file mode 100644 index 26d46bf27c3de..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetHeaders.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.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CloudHsmClusterBackupStatusGetHeaders model. - */ -@Fluent -public final class CloudHsmClusterBackupStatusGetHeaders { - /* - * The x-ms-request-id property. - */ - private String xMsRequestId; - - /* - * The Location property. - */ - private String location; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CloudHsmClusterBackupStatusGetHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CloudHsmClusterBackupStatusGetHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - public String xMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the CloudHsmClusterBackupStatusGetHeaders object itself. - */ - public CloudHsmClusterBackupStatusGetHeaders withXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the CloudHsmClusterBackupStatusGetHeaders object itself. - */ - public CloudHsmClusterBackupStatusGetHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetResponse.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetResponse.java deleted file mode 100644 index 898571897a084..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterBackupStatusGetResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.BackupResultInner; - -/** - * Contains all response data for the get operation. - */ -public final class CloudHsmClusterBackupStatusGetResponse - extends ResponseBase { - /** - * Creates an instance of CloudHsmClusterBackupStatusGetResponse. - * - * @param request the request which resulted in this CloudHsmClusterBackupStatusGetResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public CloudHsmClusterBackupStatusGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, - BackupResultInner value, CloudHsmClusterBackupStatusGetHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public BackupResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterListResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterListResult.java deleted file mode 100644 index 87ff29820b842..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterListResult.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Cloud HSM Clusters. - */ -@Fluent -public final class CloudHsmClusterListResult implements JsonSerializable { - /* - * The list of Cloud HSM Clusters. - */ - private List value; - - /* - * The URL to get the next set of Cloud HSM Clusters. - */ - private String nextLink; - - /** - * Creates an instance of CloudHsmClusterListResult class. - */ - public CloudHsmClusterListResult() { - } - - /** - * Get the value property: The list of Cloud HSM Clusters. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of Cloud HSM Clusters. - * - * @param value the value value to set. - * @return the CloudHsmClusterListResult object itself. - */ - public CloudHsmClusterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of Cloud HSM Clusters. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of Cloud HSM Clusters. - * - * @param nextLink the nextLink value to set. - * @return the CloudHsmClusterListResult object itself. - */ - public CloudHsmClusterListResult 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmClusterListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CloudHsmClusterListResult. - */ - public static CloudHsmClusterListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmClusterListResult deserializedCloudHsmClusterListResult = new CloudHsmClusterListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CloudHsmClusterInner.fromJson(reader1)); - deserializedCloudHsmClusterListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCloudHsmClusterListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmClusterListResult; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPatchParameters.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPatchParameters.java deleted file mode 100644 index d6f8d0ce50ded..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPatchParameters.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * Patchable properties of the Cloud HSM Cluster. - */ -@Fluent -public final class CloudHsmClusterPatchParameters implements JsonSerializable { - /* - * The Cloud HSM Cluster's tags - */ - private Map tags; - - /* - * Managed service identity (system assigned and/or user assigned identities) - */ - private ManagedServiceIdentity identity; - - /** - * Creates an instance of CloudHsmClusterPatchParameters class. - */ - public CloudHsmClusterPatchParameters() { - } - - /** - * Get the tags property: The Cloud HSM Cluster's tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The Cloud HSM Cluster's tags. - * - * @param tags the tags value to set. - * @return the CloudHsmClusterPatchParameters object itself. - */ - public CloudHsmClusterPatchParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * - * @return the identity value. - */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * - * @param identity the identity value to set. - * @return the CloudHsmClusterPatchParameters object itself. - */ - public CloudHsmClusterPatchParameters withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmClusterPatchParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterPatchParameters if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CloudHsmClusterPatchParameters. - */ - public static CloudHsmClusterPatchParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmClusterPatchParameters deserializedCloudHsmClusterPatchParameters - = new CloudHsmClusterPatchParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCloudHsmClusterPatchParameters.tags = tags; - } else if ("identity".equals(fieldName)) { - deserializedCloudHsmClusterPatchParameters.identity = ManagedServiceIdentity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmClusterPatchParameters; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateEndpointConnections.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateEndpointConnections.java deleted file mode 100644 index f15a22464e28c..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateEndpointConnections.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of CloudHsmClusterPrivateEndpointConnections. - */ -public interface CloudHsmClusterPrivateEndpointConnections { - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String cloudHsmClusterName, String peConnectionName); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String cloudHsmClusterName, String peConnectionName, Context context); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, - String peConnectionName, Context context); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM Cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster. - */ - PrivateEndpointConnection get(String resourceGroupName, String cloudHsmClusterName, String peConnectionName); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection for the Cloud Hsm Cluster along with {@link Response}. - */ - PrivateEndpointConnection getById(String id); - - /** - * Gets the private endpoint connection for the Cloud Hsm Cluster. - * - * @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 private endpoint connection for the Cloud Hsm Cluster along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the private endpoint connection for the Cloud Hsm Cluster. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new PrivateEndpointConnection resource. - * - * @param name resource name. - * @return the first stage of the new PrivateEndpointConnection definition. - */ - PrivateEndpointConnection.DefinitionStages.Blank define(String name); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateLinkResources.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateLinkResources.java deleted file mode 100644 index db72884b751a8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterPrivateLinkResources.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.hardwaresecuritymodules.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of CloudHsmClusterPrivateLinkResources. - */ -public interface CloudHsmClusterPrivateLinkResources { - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName); - - /** - * Gets the private link resources supported for the Cloud Hsm Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources supported for the Cloud Hsm Cluster as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName, - Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterProperties.java deleted file mode 100644 index 1195f26ad2e1f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterProperties.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import java.io.IOException; -import java.util.List; - -/** - * Properties of a Cloud HSM Cluster. - */ -@Fluent -public final class CloudHsmClusterProperties implements JsonSerializable { - /* - * State of security domain activation - */ - private ActivationState activationState; - - /* - * The Cloud HSM Cluster's auto-generated Domain Name Label Scope - */ - private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope; - - /* - * An array of Cloud HSM Cluster's HSMs - */ - private List hsms; - - /* - * List of private endpoint connection resources - */ - private List privateEndpointConnections; - - /* - * The Cloud HSM Cluster's provisioningState - */ - private ProvisioningState provisioningState; - - /* - * The Cloud HSM Cluster public network access - */ - private PublicNetworkAccess publicNetworkAccess; - - /* - * Cloud HSM Cluster status message - */ - private String statusMessage; - - /** - * Creates an instance of CloudHsmClusterProperties class. - */ - public CloudHsmClusterProperties() { - } - - /** - * Get the activationState property: State of security domain activation. - * - * @return the activationState value. - */ - public ActivationState activationState() { - return this.activationState; - } - - /** - * Get the autoGeneratedDomainNameLabelScope property: The Cloud HSM Cluster's auto-generated Domain Name Label - * Scope. - * - * @return the autoGeneratedDomainNameLabelScope value. - */ - public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { - return this.autoGeneratedDomainNameLabelScope; - } - - /** - * Set the autoGeneratedDomainNameLabelScope property: The Cloud HSM Cluster's auto-generated Domain Name Label - * Scope. - * - * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. - * @return the CloudHsmClusterProperties object itself. - */ - public CloudHsmClusterProperties - withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { - this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; - return this; - } - - /** - * Get the hsms property: An array of Cloud HSM Cluster's HSMs. - * - * @return the hsms value. - */ - public List hsms() { - return this.hsms; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connection resources. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Get the provisioningState property: The Cloud HSM Cluster's provisioningState. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the publicNetworkAccess property: The Cloud HSM Cluster public network access. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: The Cloud HSM Cluster public network access. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the CloudHsmClusterProperties object itself. - */ - public CloudHsmClusterProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the statusMessage property: Cloud HSM Cluster status message. - * - * @return the statusMessage value. - */ - public String statusMessage() { - return this.statusMessage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hsms() != null) { - hsms().forEach(e -> e.validate()); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("autoGeneratedDomainNameLabelScope", - this.autoGeneratedDomainNameLabelScope == null ? null : this.autoGeneratedDomainNameLabelScope.toString()); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmClusterProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CloudHsmClusterProperties. - */ - public static CloudHsmClusterProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmClusterProperties deserializedCloudHsmClusterProperties = new CloudHsmClusterProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("activationState".equals(fieldName)) { - deserializedCloudHsmClusterProperties.activationState - = ActivationState.fromString(reader.getString()); - } else if ("autoGeneratedDomainNameLabelScope".equals(fieldName)) { - deserializedCloudHsmClusterProperties.autoGeneratedDomainNameLabelScope - = AutoGeneratedDomainNameLabelScope.fromString(reader.getString()); - } else if ("hsms".equals(fieldName)) { - List hsms = reader.readArray(reader1 -> CloudHsmProperties.fromJson(reader1)); - deserializedCloudHsmClusterProperties.hsms = hsms; - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedCloudHsmClusterProperties.privateEndpointConnections = privateEndpointConnections; - } else if ("provisioningState".equals(fieldName)) { - deserializedCloudHsmClusterProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedCloudHsmClusterProperties.publicNetworkAccess - = PublicNetworkAccess.fromString(reader.getString()); - } else if ("statusMessage".equals(fieldName)) { - deserializedCloudHsmClusterProperties.statusMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmClusterProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatus.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatus.java deleted file mode 100644 index dfd71dd3a52f0..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatus.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.hardwaresecuritymodules.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of CloudHsmClusterRestoreStatus. - */ -public interface CloudHsmClusterRestoreStatus { - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - Response getWithResponse(String resourceGroupName, String cloudHsmClusterName, String jobId, - Context context); - - /** - * Gets the restore operation status of the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param jobId The id returned as part of the backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the restore operation status of the specified Cloud HSM Cluster. - */ - RestoreResult get(String resourceGroupName, String cloudHsmClusterName, String jobId); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetHeaders.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetHeaders.java deleted file mode 100644 index 53b986bea4725..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetHeaders.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.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CloudHsmClusterRestoreStatusGetHeaders model. - */ -@Fluent -public final class CloudHsmClusterRestoreStatusGetHeaders { - /* - * The x-ms-request-id property. - */ - private String xMsRequestId; - - /* - * The Location property. - */ - private String location; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CloudHsmClusterRestoreStatusGetHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CloudHsmClusterRestoreStatusGetHeaders(HttpHeaders rawHeaders) { - this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); - this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); - } - - /** - * Get the xMsRequestId property: The x-ms-request-id property. - * - * @return the xMsRequestId value. - */ - public String xMsRequestId() { - return this.xMsRequestId; - } - - /** - * Set the xMsRequestId property: The x-ms-request-id property. - * - * @param xMsRequestId the xMsRequestId value to set. - * @return the CloudHsmClusterRestoreStatusGetHeaders object itself. - */ - public CloudHsmClusterRestoreStatusGetHeaders withXMsRequestId(String xMsRequestId) { - this.xMsRequestId = xMsRequestId; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the CloudHsmClusterRestoreStatusGetHeaders object itself. - */ - public CloudHsmClusterRestoreStatusGetHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetResponse.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetResponse.java deleted file mode 100644 index bca2c2194bcaa..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterRestoreStatusGetResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; - -/** - * Contains all response data for the get operation. - */ -public final class CloudHsmClusterRestoreStatusGetResponse - extends ResponseBase { - /** - * Creates an instance of CloudHsmClusterRestoreStatusGetResponse. - * - * @param request the request which resulted in this CloudHsmClusterRestoreStatusGetResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public CloudHsmClusterRestoreStatusGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, - RestoreResultInner value, CloudHsmClusterRestoreStatusGetHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public RestoreResultInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSku.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSku.java deleted file mode 100644 index 9d6dfd9300a66..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSku.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Cloud Hsm Cluster SKU information. - */ -@Fluent -public final class CloudHsmClusterSku implements JsonSerializable { - /* - * Sku family of the Cloud HSM Cluster - */ - private CloudHsmClusterSkuFamily family = CloudHsmClusterSkuFamily.B; - - /* - * Sku name of the Cloud HSM Cluster - */ - private CloudHsmClusterSkuName name; - - /* - * Sku capacity - */ - private Integer capacity; - - /** - * Creates an instance of CloudHsmClusterSku class. - */ - public CloudHsmClusterSku() { - } - - /** - * Get the family property: Sku family of the Cloud HSM Cluster. - * - * @return the family value. - */ - public CloudHsmClusterSkuFamily family() { - return this.family; - } - - /** - * Set the family property: Sku family of the Cloud HSM Cluster. - * - * @param family the family value to set. - * @return the CloudHsmClusterSku object itself. - */ - public CloudHsmClusterSku withFamily(CloudHsmClusterSkuFamily family) { - this.family = family; - return this; - } - - /** - * Get the name property: Sku name of the Cloud HSM Cluster. - * - * @return the name value. - */ - public CloudHsmClusterSkuName name() { - return this.name; - } - - /** - * Set the name property: Sku name of the Cloud HSM Cluster. - * - * @param name the name value to set. - * @return the CloudHsmClusterSku object itself. - */ - public CloudHsmClusterSku withName(CloudHsmClusterSkuName name) { - this.name = name; - return this; - } - - /** - * Get the capacity property: Sku capacity. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Sku capacity. - * - * @param capacity the capacity value to set. - * @return the CloudHsmClusterSku object itself. - */ - public CloudHsmClusterSku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (family() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property family in model CloudHsmClusterSku")); - } - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model CloudHsmClusterSku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CloudHsmClusterSku.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("family", this.family == null ? null : this.family.toString()); - jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); - jsonWriter.writeNumberField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmClusterSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterSku if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CloudHsmClusterSku. - */ - public static CloudHsmClusterSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmClusterSku deserializedCloudHsmClusterSku = new CloudHsmClusterSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("family".equals(fieldName)) { - deserializedCloudHsmClusterSku.family = CloudHsmClusterSkuFamily.fromString(reader.getString()); - } else if ("name".equals(fieldName)) { - deserializedCloudHsmClusterSku.name = CloudHsmClusterSkuName.fromString(reader.getString()); - } else if ("capacity".equals(fieldName)) { - deserializedCloudHsmClusterSku.capacity = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmClusterSku; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuFamily.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuFamily.java deleted file mode 100644 index 4afce55d60d8f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuFamily.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Sku family of the Cloud HSM Cluster. - */ -public final class CloudHsmClusterSkuFamily extends ExpandableStringEnum { - /** - * Static value B for CloudHsmClusterSkuFamily. - */ - public static final CloudHsmClusterSkuFamily B = fromString("B"); - - /** - * Creates a new instance of CloudHsmClusterSkuFamily value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CloudHsmClusterSkuFamily() { - } - - /** - * Creates or finds a CloudHsmClusterSkuFamily from its string representation. - * - * @param name a name to look for. - * @return the corresponding CloudHsmClusterSkuFamily. - */ - public static CloudHsmClusterSkuFamily fromString(String name) { - return fromString(name, CloudHsmClusterSkuFamily.class); - } - - /** - * Gets known CloudHsmClusterSkuFamily values. - * - * @return known CloudHsmClusterSkuFamily values. - */ - public static Collection values() { - return values(CloudHsmClusterSkuFamily.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuName.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuName.java deleted file mode 100644 index ae55df435d173..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterSkuName.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -/** - * Sku name of the Cloud HSM Cluster. - */ -public enum CloudHsmClusterSkuName { - /** - * Enum value Standard_B1. - */ - STANDARD_B1("Standard_B1"), - - /** - * Enum value Standard B10. - */ - STANDARD_B10("Standard B10"); - - /** - * The actual serialized value for a CloudHsmClusterSkuName instance. - */ - private final String value; - - CloudHsmClusterSkuName(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CloudHsmClusterSkuName instance. - * - * @param value the serialized value to parse. - * @return the parsed CloudHsmClusterSkuName object, or null if unable to parse. - */ - public static CloudHsmClusterSkuName fromString(String value) { - if (value == null) { - return null; - } - CloudHsmClusterSkuName[] items = CloudHsmClusterSkuName.values(); - for (CloudHsmClusterSkuName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusters.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusters.java deleted file mode 100644 index dd100406091f9..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusters.java +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.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 CloudHsmClusters. - */ -public interface CloudHsmClusters { - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String cloudHsmClusterName, - Context context); - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster. - */ - CloudHsmCluster getByResourceGroup(String resourceGroupName, String cloudHsmClusterName); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 cloudHsmClusterName); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String cloudHsmClusterName, Context context); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the - * specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, Context context); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the 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 list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * The List operation gets information about the Cloud HSM Clusters associated with the subscription. - * - * @param skiptoken The page-continuation token to use with a paged version of this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Cloud HSM Clusters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String skiptoken, Context context); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult validateBackupProperties(String resourceGroupName, String cloudHsmClusterName); - - /** - * Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in - * the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Backup Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult validateBackupProperties(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult backup(String resourceGroupName, String cloudHsmClusterName); - - /** - * Create a backup of the Cloud HSM Cluster in the specified subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param backupRequestProperties Azure storage Resource Uri. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup operation Result. - */ - BackupResult backup(String resourceGroupName, String cloudHsmClusterName, - BackupRequestProperties backupRequestProperties, Context context); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName); - - /** - * Queued validating pre restore operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Optional Parameters to validate prior performing a restore operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult validateRestoreProperties(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties); - - /** - * Restores all key materials of a specified Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param restoreRequestProperties Restore Operation Required properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return restore operation properties. - */ - RestoreResult restore(String resourceGroupName, String cloudHsmClusterName, - RestoreRequestProperties restoreRequestProperties, Context context); - - /** - * Gets the specified Cloud HSM Cluster. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Cloud HSM Cluster along with {@link Response}. - */ - CloudHsmCluster getById(String id); - - /** - * Gets the specified Cloud HSM Cluster. - * - * @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 specified Cloud HSM Cluster along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the specified Cloud HSM Cluster. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CloudHsmCluster resource. - * - * @param name resource name. - * @return the first stage of the new CloudHsmCluster definition. - */ - CloudHsmCluster.DefinitionStages.Blank define(String name); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmProperties.java deleted file mode 100644 index dc9c856622075..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmProperties.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Cloud HSM Properties. - */ -@Fluent -public final class CloudHsmProperties implements JsonSerializable { - /* - * FQDN of the Cloud HSM - */ - private String fqdn; - - /* - * The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, - * DeletingSlbEntry, InitialProvisioning, Updating - */ - private String state; - - /* - * The Cloud HSM State message - */ - private String stateMessage; - - /** - * Creates an instance of CloudHsmProperties class. - */ - public CloudHsmProperties() { - } - - /** - * Get the fqdn property: FQDN of the Cloud HSM. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Set the fqdn property: FQDN of the Cloud HSM. - * - * @param fqdn the fqdn value to set. - * @return the CloudHsmProperties object itself. - */ - public CloudHsmProperties withFqdn(String fqdn) { - this.fqdn = fqdn; - return this; - } - - /** - * Get the state property: The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, - * Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, - * Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating. - * - * @param state the state value to set. - * @return the CloudHsmProperties object itself. - */ - public CloudHsmProperties withState(String state) { - this.state = state; - return this; - } - - /** - * Get the stateMessage property: The Cloud HSM State message. - * - * @return the stateMessage value. - */ - public String stateMessage() { - return this.stateMessage; - } - - /** - * Set the stateMessage property: The Cloud HSM State message. - * - * @param stateMessage the stateMessage value to set. - * @return the CloudHsmProperties object itself. - */ - public CloudHsmProperties withStateMessage(String stateMessage) { - this.stateMessage = stateMessage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fqdn", this.fqdn); - jsonWriter.writeStringField("state", this.state); - jsonWriter.writeStringField("stateMessage", this.stateMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudHsmProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the CloudHsmProperties. - */ - public static CloudHsmProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudHsmProperties deserializedCloudHsmProperties = new CloudHsmProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("fqdn".equals(fieldName)) { - deserializedCloudHsmProperties.fqdn = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedCloudHsmProperties.state = reader.getString(); - } else if ("stateMessage".equals(fieldName)) { - deserializedCloudHsmProperties.stateMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudHsmProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsm.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsm.java index 943c44fc99fe6..0e2902709de42 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsm.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsm.java @@ -65,18 +65,18 @@ public interface DedicatedHsm { List zones(); /** - * Gets the properties property: Properties of the dedicated HSM. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the properties value. + * @return the systemData value. */ - DedicatedHsmProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the properties property: Properties of the dedicated HSM. * - * @return the systemData value. + * @return the properties value. */ - SystemData systemData(); + DedicatedHsmProperties properties(); /** * Gets the region of the resource. @@ -109,9 +109,8 @@ public interface DedicatedHsm { /** * The entirety of the DedicatedHsm definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithSku, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -152,23 +151,10 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithSku withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the DedicatedHsm definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: SKU details. - * - * @param sku SKU details. + * @param resourceGroupName The name of the Resource Group to which the resource belongs. * @return the next definition stage. */ - WithProperties withSku(Sku sku); + WithProperties withExistingResourceGroup(String resourceGroupName); } /** @@ -188,7 +174,7 @@ interface WithProperties { * The stage of the DedicatedHsm 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.WithZones { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithZones { /** * Executes the create request. * @@ -218,6 +204,19 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the DedicatedHsm definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: SKU details. + * + * @param sku SKU details. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** * The stage of the DedicatedHsm definition allowing to specify zones. */ diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperation.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperation.java new file mode 100644 index 0000000000000..8a91615715d1b --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.models; + +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; + +/** + * An immutable client-side representation of DedicatedHsmOperation. + */ +public interface DedicatedHsmOperation { + /** + * Gets the name property: The name of the Dedicated HSM Resource Provider Operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Gets or sets a value indicating whether it is a data plane action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the origin property: The origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the display property: The display string. + * + * @return the display value. + */ + DedicatedHsmOperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner object. + * + * @return the inner object. + */ + DedicatedHsmOperationInner innerModel(); +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationDisplay.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationDisplay.java new file mode 100644 index 0000000000000..fdb777fadb3f8 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationDisplay.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The display string. + */ +@Fluent +public final class DedicatedHsmOperationDisplay implements JsonSerializable { + /* + * The Resource Provider of the operation + */ + private String provider; + + /* + * Resource on which the operation is performed. + */ + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + private String operation; + + /* + * The object that represents the operation. + */ + private String description; + + /** + * Creates an instance of DedicatedHsmOperationDisplay class. + */ + public DedicatedHsmOperationDisplay() { + } + + /** + * Get the provider property: The Resource Provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The Resource Provider of the operation. + * + * @param provider the provider value to set. + * @return the DedicatedHsmOperationDisplay object itself. + */ + public DedicatedHsmOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the DedicatedHsmOperationDisplay object itself. + */ + public DedicatedHsmOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: Read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the DedicatedHsmOperationDisplay object itself. + */ + public DedicatedHsmOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The object that represents the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The object that represents the operation. + * + * @param description the description value to set. + * @return the DedicatedHsmOperationDisplay object itself. + */ + public DedicatedHsmOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DedicatedHsmOperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DedicatedHsmOperationDisplay if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DedicatedHsmOperationDisplay. + */ + public static DedicatedHsmOperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DedicatedHsmOperationDisplay deserializedDedicatedHsmOperationDisplay = new DedicatedHsmOperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedDedicatedHsmOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedDedicatedHsmOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedDedicatedHsmOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDedicatedHsmOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDedicatedHsmOperationDisplay; + }); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationListResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationListResult.java new file mode 100644 index 0000000000000..b27d68eab281c --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmOperationListResult.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list Dedicated HSM Provider operations. It contains a list of operations. + */ +@Fluent +public final class DedicatedHsmOperationListResult implements JsonSerializable { + /* + * List of Dedicated HSM Resource Provider operations. + */ + private List value; + + /** + * Creates an instance of DedicatedHsmOperationListResult class. + */ + public DedicatedHsmOperationListResult() { + } + + /** + * Get the value property: List of Dedicated HSM Resource Provider operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Dedicated HSM Resource Provider operations. + * + * @param value the value value to set. + * @return the DedicatedHsmOperationListResult object itself. + */ + public DedicatedHsmOperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DedicatedHsmOperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DedicatedHsmOperationListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DedicatedHsmOperationListResult. + */ + public static DedicatedHsmOperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DedicatedHsmOperationListResult deserializedDedicatedHsmOperationListResult + = new DedicatedHsmOperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DedicatedHsmOperationInner.fromJson(reader1)); + deserializedDedicatedHsmOperationListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedDedicatedHsmOperationListResult; + }); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterResource.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmResource.java similarity index 51% rename from sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterResource.java rename to sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmResource.java index 72f4cbf0313a6..5dcf3d61f85bc 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/CloudHsmClusterResource.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsmResource.java @@ -6,32 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; import java.util.Map; /** - * Cloud HSM Cluster Resource. + * Dedicated HSM resource. */ @Fluent -public class CloudHsmClusterResource extends Resource { - /* - * Managed service identity (system assigned and/or user assigned identities) - */ - private ManagedServiceIdentity identity; - +public class DedicatedHsmResource extends Resource { /* * SKU details */ - private CloudHsmClusterSku sku; + private Sku sku; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The Dedicated Hsm zones. */ - private SystemData systemData; + private List zones; /* * The type of the resource. @@ -49,29 +44,9 @@ public class CloudHsmClusterResource extends Resource { private String id; /** - * Creates an instance of CloudHsmClusterResource class. - */ - public CloudHsmClusterResource() { - } - - /** - * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * - * @return the identity value. + * Creates an instance of DedicatedHsmResource class. */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * - * @param identity the identity value to set. - * @return the CloudHsmClusterResource object itself. - */ - public CloudHsmClusterResource withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; + public DedicatedHsmResource() { } /** @@ -79,7 +54,7 @@ public CloudHsmClusterResource withIdentity(ManagedServiceIdentity identity) { * * @return the sku value. */ - public CloudHsmClusterSku sku() { + public Sku sku() { return this.sku; } @@ -87,30 +62,30 @@ public CloudHsmClusterSku sku() { * Set the sku property: SKU details. * * @param sku the sku value to set. - * @return the CloudHsmClusterResource object itself. + * @return the DedicatedHsmResource object itself. */ - public CloudHsmClusterResource withSku(CloudHsmClusterSku sku) { + public DedicatedHsmResource withSku(Sku sku) { this.sku = sku; return this; } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the zones property: The Dedicated Hsm zones. * - * @return the systemData value. + * @return the zones value. */ - public SystemData systemData() { - return this.systemData; + public List zones() { + return this.zones; } /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Set the zones property: The Dedicated Hsm zones. * - * @param systemData the systemData value to set. - * @return the CloudHsmClusterResource object itself. + * @param zones the zones value to set. + * @return the DedicatedHsmResource object itself. */ - CloudHsmClusterResource withSystemData(SystemData systemData) { - this.systemData = systemData; + public DedicatedHsmResource withZones(List zones) { + this.zones = zones; return this; } @@ -148,7 +123,7 @@ public String id() { * {@inheritDoc} */ @Override - public CloudHsmClusterResource withLocation(String location) { + public DedicatedHsmResource withLocation(String location) { super.withLocation(location); return this; } @@ -157,7 +132,7 @@ public CloudHsmClusterResource withLocation(String location) { * {@inheritDoc} */ @Override - public CloudHsmClusterResource withTags(Map tags) { + public DedicatedHsmResource withTags(Map tags) { super.withTags(tags); return this; } @@ -168,9 +143,6 @@ public CloudHsmClusterResource withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } if (sku() != null) { sku().validate(); } @@ -184,50 +156,49 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } /** - * Reads an instance of CloudHsmClusterResource from the JsonReader. + * Reads an instance of DedicatedHsmResource from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CloudHsmClusterResource if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of DedicatedHsmResource if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CloudHsmClusterResource. + * @throws IOException If an error occurs while reading the DedicatedHsmResource. */ - public static CloudHsmClusterResource fromJson(JsonReader jsonReader) throws IOException { + public static DedicatedHsmResource fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - CloudHsmClusterResource deserializedCloudHsmClusterResource = new CloudHsmClusterResource(); + DedicatedHsmResource deserializedDedicatedHsmResource = new DedicatedHsmResource(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedCloudHsmClusterResource.id = reader.getString(); + deserializedDedicatedHsmResource.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedCloudHsmClusterResource.name = reader.getString(); + deserializedDedicatedHsmResource.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedCloudHsmClusterResource.type = reader.getString(); + deserializedDedicatedHsmResource.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedCloudHsmClusterResource.withLocation(reader.getString()); + deserializedDedicatedHsmResource.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCloudHsmClusterResource.withTags(tags); - } else if ("identity".equals(fieldName)) { - deserializedCloudHsmClusterResource.identity = ManagedServiceIdentity.fromJson(reader); + deserializedDedicatedHsmResource.withTags(tags); } else if ("sku".equals(fieldName)) { - deserializedCloudHsmClusterResource.sku = CloudHsmClusterSku.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCloudHsmClusterResource.systemData = SystemData.fromJson(reader); + deserializedDedicatedHsmResource.sku = Sku.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedDedicatedHsmResource.zones = zones; } else { reader.skipChildren(); } } - return deserializedCloudHsmClusterResource; + return deserializedDedicatedHsmResource; }); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsms.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsms.java index 750a3a4c53baf..e946c0af6cfc6 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsms.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/DedicatedHsms.java @@ -15,8 +15,8 @@ public interface DedicatedHsms { /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -27,8 +27,8 @@ public interface DedicatedHsms { /** * Deletes the specified Azure Dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. + * @param name The name of the dedicated HSM to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -40,8 +40,8 @@ public interface DedicatedHsms { /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected @@ -54,8 +54,8 @@ public interface DedicatedHsms { /** * Gets the specified Azure dedicated HSM. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -68,7 +68,7 @@ public interface DedicatedHsms { * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -81,7 +81,7 @@ public interface DedicatedHsms { * The List operation gets information about the dedicated hsms associated with the subscription and within the * specified resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,8 +122,8 @@ public interface DedicatedHsms { * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected * by server. @@ -141,8 +141,8 @@ PagedIterable listOutboundNetworkDependenciesEndpoi * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm * resource. The operation returns properties of each egress endpoint. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of the dedicated Hsm. + * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs. + * @param name The name of the dedicated HSM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentity.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentity.java deleted file mode 100644 index cdc04afd0c46e..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentity.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; -import java.util.UUID; - -/** - * Managed service identity (system assigned and/or user assigned identities). - */ -@Fluent -public final class ManagedServiceIdentity implements JsonSerializable { - /* - * The service principal ID of the system assigned identity. This property will only be provided for a system - * assigned identity. - */ - private UUID principalId; - - /* - * The tenant ID of the system assigned identity. This property will only be provided for a system assigned - * identity. - */ - private UUID tenantId; - - /* - * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - */ - private ManagedServiceIdentityType type; - - /* - * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will - * be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. - */ - private Map userAssignedIdentities; - - /** - * Creates an instance of ManagedServiceIdentity class. - */ - public ManagedServiceIdentity() { - } - - /** - * Get the principalId property: The service principal ID of the system assigned identity. This property will only - * be provided for a system assigned identity. - * - * @return the principalId value. - */ - public UUID principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for - * a system assigned identity. - * - * @return the tenantId value. - */ - public UUID tenantId() { - return this.tenantId; - } - - /** - * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). - * - * @return the type value. - */ - public ManagedServiceIdentityType type() { - return this.type; - } - - /** - * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). - * - * @param type the type value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedServiceIdentity object itself. - */ - public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); - } - if (userAssignedIdentities() != null) { - userAssignedIdentities().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedServiceIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ManagedServiceIdentity. - */ - public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); - } else if ("principalId".equals(fieldName)) { - deserializedManagedServiceIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("tenantId".equals(fieldName)) { - deserializedManagedServiceIdentity.tenantId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("userAssignedIdentities".equals(fieldName)) { - Map userAssignedIdentities - = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); - deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedServiceIdentity; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentityType.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentityType.java deleted file mode 100644 index 1054c5c20eab1..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ManagedServiceIdentityType.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - */ -public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** - * Static value None for ManagedServiceIdentityType. - */ - public static final ManagedServiceIdentityType NONE = fromString("None"); - - /** - * Static value SystemAssigned for ManagedServiceIdentityType. - */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Static value UserAssigned for ManagedServiceIdentityType. - */ - public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** - * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. - */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED - = fromString("SystemAssigned,UserAssigned"); - - /** - * Creates a new instance of ManagedServiceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedServiceIdentityType() { - } - - /** - * Creates or finds a ManagedServiceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedServiceIdentityType. - */ - public static ManagedServiceIdentityType fromString(String name) { - return fromString(name, ManagedServiceIdentityType.class); - } - - /** - * Gets known ManagedServiceIdentityType values. - * - * @return known ManagedServiceIdentityType values. - */ - public static Collection values() { - return values(ManagedServiceIdentityType.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/NetworkInterface.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/NetworkInterface.java index 2b0248fd321ab..b3630a6b23bd0 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/NetworkInterface.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/NetworkInterface.java @@ -17,9 +17,9 @@ @Fluent public final class NetworkInterface implements JsonSerializable { /* - * The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ - private String resourceId; + private String id; /* * Private Ip address of the interface @@ -33,13 +33,13 @@ public NetworkInterface() { } /** - * Get the resourceId property: The Azure resource id in the form of + * Get the id property: The ARM resource id in the form of * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... * - * @return the resourceId value. + * @return the id value. */ - public String resourceId() { - return this.resourceId; + public String id() { + return this.id; } /** @@ -95,8 +95,8 @@ public static NetworkInterface fromJson(JsonReader jsonReader) throws IOExceptio String fieldName = reader.getFieldName(); reader.nextToken(); - if ("resourceId".equals(fieldName)) { - deserializedNetworkInterface.resourceId = reader.getString(); + if ("id".equals(fieldName)) { + deserializedNetworkInterface.id = reader.getString(); } else if ("privateIpAddress".equals(fieldName)) { deserializedNetworkInterface.privateIpAddress = reader.getString(); } else { diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operation.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operation.java deleted file mode 100644 index b075289a485d0..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationDisplay.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationDisplay.java deleted file mode 100644 index c9b98ad61e219..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationDisplay.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Localized display information for this particular operation. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or - * "Microsoft Compute". - */ - private String provider; - - /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or - * "Job Schedule Collections". - */ - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - */ - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - public OperationDisplay() { - } - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationListResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationListResult.java deleted file mode 100644 index 6724b19a8385a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/OperationListResult.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * List of operations supported by the resource provider - */ - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - private String nextLink; - - /** - * Creates an instance of OperationListResult class. - */ - public OperationListResult() { - } - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationListResult. - */ - public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationListResult deserializedOperationListResult = new OperationListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationListResult; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operations.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operations.java index 6d84fb2895695..007b6726a9993 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operations.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Operations.java @@ -12,22 +12,24 @@ */ public interface Operations { /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected + * by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Get a list of Hardware Security Modules operations. + * Get a list of Dedicated HSM operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.hardwaresecuritymodules.models.ErrorException thrown if the request is rejected + * by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Hardware Security Modules operations as paginated response with {@link PagedIterable}. + * @return a list of Dedicated HSM operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Origin.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Origin.java deleted file mode 100644 index 20f7ef248385c..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/Origin.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value - * is "user,system". - */ -public final class Origin extends ExpandableStringEnum { - /** - * Static value user for Origin. - */ - public static final Origin USER = fromString("user"); - - /** - * Static value system for Origin. - */ - public static final Origin SYSTEM = fromString("system"); - - /** - * Static value user,system for Origin. - */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates a new instance of Origin value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Origin() { - } - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpoint.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpoint.java deleted file mode 100644 index 7327a1d843cdd..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpoint.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The private endpoint resource. - */ -@Immutable -public final class PrivateEndpoint implements JsonSerializable { - /* - * The ARM identifier for private endpoint. - */ - private String id; - - /** - * Creates an instance of PrivateEndpoint class. - */ - public PrivateEndpoint() { - } - - /** - * Get the id property: The ARM identifier for private endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateEndpoint. - */ - public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpoint.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpoint; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnection.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnection.java deleted file mode 100644 index 7665a97c8711a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; - -/** - * An immutable client-side representation of PrivateEndpointConnection. - */ -public interface PrivateEndpointConnection { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Resource properties. - * - * @return the properties value. - */ - PrivateEndpointConnectionProperties properties(); - - /** - * Gets the etag property: Modified whenever there is a change in the state of private endpoint connection. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner - * object. - * - * @return the inner object. - */ - PrivateEndpointConnectionInner innerModel(); - - /** - * The entirety of the PrivateEndpointConnection definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The PrivateEndpointConnection definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the PrivateEndpointConnection definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, cloudHsmClusterName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud - * HSM Cluster names must be between 3 and 23 characters in length. - * @return the next definition stage. - */ - WithCreate withExistingCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName); - } - - /** - * The stage of the PrivateEndpointConnection 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.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - PrivateEndpointConnection create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PrivateEndpointConnection create(Context context); - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Resource properties.. - * - * @param properties Resource properties. - * @return the next definition stage. - */ - WithCreate withProperties(PrivateEndpointConnectionProperties properties); - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Modified whenever there is a change in the state of private endpoint - * connection.. - * - * @param etag Modified whenever there is a change in the state of private endpoint connection. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionListResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index e0b0a0b80bd79..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import java.io.IOException; -import java.util.List; - -/** - * List of private endpoint connections associated with the specified resource. - */ -@Fluent -public final class PrivateEndpointConnectionListResult - implements JsonSerializable { - /* - * Array of private endpoint connections. - */ - private List value; - - /* - * The URL to get the next set of private endpoint connections. - */ - private String nextLink; - - /** - * Creates an instance of PrivateEndpointConnectionListResult class. - */ - public PrivateEndpointConnectionListResult() { - } - - /** - * Get the value property: Array of private endpoint connections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of private endpoint connections. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of private endpoint connections. - * - * @param nextLink the nextLink value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult 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()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. - */ - public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult - = new PrivateEndpointConnectionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedPrivateEndpointConnectionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionListResult; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 19ed791d53338..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Properties of the private endpoint connection. - */ -@Fluent -public final class PrivateEndpointConnectionProperties - implements JsonSerializable { - /* - * The private endpoint resource. - */ - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between service consumer and provider. - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. - */ - private PrivateEndpointConnectionProvisioningState provisioningState; - - /* - * The group ids for the private endpoint resource. - */ - private List groupIds; - - /** - * Creates an instance of PrivateEndpointConnectionProperties class. - */ - public PrivateEndpointConnectionProperties() { - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. - */ - public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties - = new PrivateEndpointConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.provisioningState - = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); - } else if ("groupIds".equals(fieldName)) { - List groupIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProvisioningState.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 898be9c8bfacd..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Updating for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); - - /** - * Static value InternalError for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState INTERNAL_ERROR = fromString("InternalError"); - - /** - * Static value Canceled for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointConnectionProvisioningState() { - } - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** - * Gets known PrivateEndpointConnectionProvisioningState values. - * - * @return known PrivateEndpointConnectionProvisioningState values. - */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnections.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnections.java deleted file mode 100644 index abcf5eb36b07a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointConnections.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateEndpointConnections. - */ -public interface PrivateEndpointConnections { - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCloudHsmCluster(String resourceGroupName, - String cloudHsmClusterName); - - /** - * The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM - * Cluster names must be between 3 and 23 characters in length. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections associated with the specified resource as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByCloudHsmCluster(String resourceGroupName, String cloudHsmClusterName, - Context context); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointServiceConnectionStatus.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 9f0dec6877724..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The private endpoint connection status. - */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. - */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointServiceConnectionStatus() { - } - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** - * Gets known PrivateEndpointServiceConnectionStatus values. - * - * @return known PrivateEndpointServiceConnectionStatus values. - */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResource.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResource.java deleted file mode 100644 index 658888896afee..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResource.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; - -/** - * An immutable client-side representation of PrivateLinkResource. - */ -public interface PrivateLinkResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Resource properties. - * - * @return the properties value. - */ - PrivateLinkResourceProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner object. - * - * @return the inner object. - */ - PrivateLinkResourceInner innerModel(); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceListResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceListResult.java deleted file mode 100644 index 22d79cffe15bb..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceListResult.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of private link resources. - */ -@Fluent -public final class PrivateLinkResourceListResult implements JsonSerializable { - /* - * Array of private link resources - */ - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - private String nextLink; - - /** - * Creates an instance of PrivateLinkResourceListResult class. - */ - public PrivateLinkResourceListResult() { - } - - /** - * Get the value property: Array of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. - */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. - */ - public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult - = new PrivateLinkResourceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); - deserializedPrivateLinkResourceListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceListResult; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceProperties.java deleted file mode 100644 index 4fb2061e8cee5..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Properties of a private link resource. - */ -@Fluent -public final class PrivateLinkResourceProperties implements JsonSerializable { - /* - * The private link resource group id. - */ - private String groupId; - - /* - * The private link resource required member names. - */ - private List requiredMembers; - - /* - * The private link resource private link DNS zone name. - */ - private List requiredZoneNames; - - /** - * Creates an instance of PrivateLinkResourceProperties class. - */ - public PrivateLinkResourceProperties() { - } - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: The private link resource private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * Set the requiredZoneNames property: The private link resource private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. - */ - public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties - = new PrivateLinkResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedPrivateLinkResourceProperties.groupId = reader.getString(); - } else if ("requiredMembers".equals(fieldName)) { - List requiredMembers = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; - } else if ("requiredZoneNames".equals(fieldName)) { - List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkServiceConnectionState.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 45df2aee158dc..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A collection of information about the state of the connection between service consumer and provider. - */ -@Fluent -public final class PrivateLinkServiceConnectionState implements JsonSerializable { - /* - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - */ - private PrivateEndpointServiceConnectionStatus status; - - /* - * The reason for approval/rejection of the connection. - */ - private String description; - - /* - * A message indicating if changes on the service provider require any updates on the consumer. - */ - private String actionsRequired; - - /** - * Creates an instance of PrivateLinkServiceConnectionState class. - */ - public PrivateLinkServiceConnectionState() { - } - - /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @return the status value. - */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The reason for approval/rejection of the connection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The reason for approval/rejection of the connection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @param actionsRequired the actionsRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("actionsRequired", this.actionsRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. - */ - public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState - = new PrivateLinkServiceConnectionState(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.status - = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.description = reader.getString(); - } else if ("actionsRequired".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkServiceConnectionState; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ProvisioningState.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ProvisioningState.java deleted file mode 100644 index 8fb7b02d9672d..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/ProvisioningState.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The Cloud HSM Cluster's provisioningState. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** - * Static value Provisioning for ProvisioningState. - */ - public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - - /** - * Static value Succeeded for ProvisioningState. - */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for ProvisioningState. - */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Deleting for ProvisioningState. - */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Canceled for ProvisioningState. - */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PublicNetworkAccess.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PublicNetworkAccess.java deleted file mode 100644 index a9b907c8256be..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/PublicNetworkAccess.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The Cloud HSM Cluster public network access. - */ -public final class PublicNetworkAccess extends ExpandableStringEnum { - /** - * Static value Disabled for PublicNetworkAccess. - */ - public static final PublicNetworkAccess DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of PublicNetworkAccess value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PublicNetworkAccess() { - } - - /** - * Creates or finds a PublicNetworkAccess from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicNetworkAccess. - */ - public static PublicNetworkAccess fromString(String name) { - return fromString(name, PublicNetworkAccess.class); - } - - /** - * Gets known PublicNetworkAccess values. - * - * @return known PublicNetworkAccess values. - */ - public static Collection values() { - return values(PublicNetworkAccess.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreRequestProperties.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreRequestProperties.java deleted file mode 100644 index 5e823578bd925..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreRequestProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Cloud Hsm Cluster restore information. - */ -@Fluent -public final class RestoreRequestProperties extends BackupRestoreRequestBaseProperties { - /* - * An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp. - */ - private String backupId; - - /** - * Creates an instance of RestoreRequestProperties class. - */ - public RestoreRequestProperties() { - } - - /** - * Get the backupId property: An autogenerated unique string ID for labeling the backup. It contains both a UUID and - * a date timestamp. - * - * @return the backupId value. - */ - public String backupId() { - return this.backupId; - } - - /** - * Set the backupId property: An autogenerated unique string ID for labeling the backup. It contains both a UUID and - * a date timestamp. - * - * @param backupId the backupId value to set. - * @return the RestoreRequestProperties object itself. - */ - public RestoreRequestProperties withBackupId(String backupId) { - this.backupId = backupId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestoreRequestProperties withAzureStorageBlobContainerUri(String azureStorageBlobContainerUri) { - super.withAzureStorageBlobContainerUri(azureStorageBlobContainerUri); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestoreRequestProperties withToken(String token) { - super.withToken(token); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (backupId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property backupId in model RestoreRequestProperties")); - } - if (azureStorageBlobContainerUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property azureStorageBlobContainerUri in model RestoreRequestProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RestoreRequestProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("azureStorageBlobContainerUri", azureStorageBlobContainerUri()); - jsonWriter.writeStringField("token", token()); - jsonWriter.writeStringField("backupId", this.backupId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RestoreRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RestoreRequestProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RestoreRequestProperties. - */ - public static RestoreRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RestoreRequestProperties deserializedRestoreRequestProperties = new RestoreRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureStorageBlobContainerUri".equals(fieldName)) { - deserializedRestoreRequestProperties.withAzureStorageBlobContainerUri(reader.getString()); - } else if ("token".equals(fieldName)) { - deserializedRestoreRequestProperties.withToken(reader.getString()); - } else if ("backupId".equals(fieldName)) { - deserializedRestoreRequestProperties.backupId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRestoreRequestProperties; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreResult.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreResult.java deleted file mode 100644 index 09a47ed58cfc0..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/RestoreResult.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.hardwaresecuritymodules.models; - -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner; - -/** - * An immutable client-side representation of RestoreResult. - */ -public interface RestoreResult { - /** - * Gets the properties property: Backup and Restore operation common properties. - * - * @return the properties value. - */ - BackupRestoreBaseResultProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.RestoreResultInner object. - * - * @return the inner object. - */ - RestoreResultInner innerModel(); -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/UserAssignedIdentity.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/UserAssignedIdentity.java deleted file mode 100644 index 9dd8f8b5edf26..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/java/com/azure/resourcemanager/hardwaresecuritymodules/models/UserAssignedIdentity.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.UUID; - -/** - * User assigned identity properties. - */ -@Immutable -public final class UserAssignedIdentity implements JsonSerializable { - /* - * The principal ID of the assigned identity. - */ - private UUID principalId; - - /* - * The client ID of the assigned identity. - */ - private UUID clientId; - - /** - * Creates an instance of UserAssignedIdentity class. - */ - public UserAssignedIdentity() { - } - - /** - * Get the principalId property: The principal ID of the assigned identity. - * - * @return the principalId value. - */ - public UUID principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client ID of the assigned identity. - * - * @return the clientId value. - */ - public UUID clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserAssignedIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the UserAssignedIdentity. - */ - public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedUserAssignedIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedUserAssignedIdentity; - }); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hardwaresecuritymodules/proxy-config.json b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hardwaresecuritymodules/proxy-config.json index 5a52365e3afdd..a8f46d291c614 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hardwaresecuritymodules/proxy-config.json +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hardwaresecuritymodules/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterBackupStatusClientImpl$CloudHsmClusterBackupStatusService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterPrivateEndpointConnectionsClientImpl$CloudHsmClusterPrivateEndpointConnectionsService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterPrivateLinkResourcesClientImpl$CloudHsmClusterPrivateLinkResourcesService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClusterRestoreStatusClientImpl$CloudHsmClusterRestoreStatusService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.CloudHsmClustersClientImpl$CloudHsmClustersService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.DedicatedHsmsClientImpl$DedicatedHsmsService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"]] \ No newline at end of file +[["com.azure.resourcemanager.hardwaresecuritymodules.implementation.DedicatedHsmsClientImpl$DedicatedHsmsService"],["com.azure.resourcemanager.hardwaresecuritymodules.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterBackupStatusGetSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterBackupStatusGetSamples.java deleted file mode 100644 index 5c24f8f2424f9..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterBackupStatusGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterBackupStatus Get. - */ -public final class CloudHsmClusterBackupStatusGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_Backup_Status_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetBackupStatusMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterBackupStatus() - .getWithResponse("rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateSamples.java deleted file mode 100644 index 7c8bac1fcd53b..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; - -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Create. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsCreateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionCreateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .define("sample-pec") - .withExistingCloudHsmCluster("rgcloudhsm", "chsm1") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("My name is Joe and I'm approving this."))) - .create(); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsDeleteSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsDeleteSamples.java deleted file mode 100644 index 8289b37c7df0b..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsDeleteSamples.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.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Delete. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsDeleteSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionDeleteMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .delete("rgcloudhsm", "chsm1", "sample-pec", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetSamples.java deleted file mode 100644 index 9bd5aaa276e87..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetSamples.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.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterPrivateEndpointConnections Get. - */ -public final class CloudHsmClusterPrivateEndpointConnectionsGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionGetMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateEndpointConnections() - .getWithResponse("rgcloudhsm", "chsm1", "sample-pec", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.java deleted file mode 100644 index 8794915d84149..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples.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.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterPrivateLinkResources ListByCloudHsmCluster. - */ -public final class CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateLinkResourcesListByResourceMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterPrivateLinkResources() - .listByCloudHsmCluster("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterRestoreStatusGetSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterRestoreStatusGetSamples.java deleted file mode 100644 index 50c3e33af1926..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterRestoreStatusGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusterRestoreStatus Get. - */ -public final class CloudHsmClusterRestoreStatusGetSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_Restore_Status_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetRestoreStatusMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusterRestoreStatus() - .getWithResponse("rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersBackupSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersBackupSamples.java deleted file mode 100644 index 640d948f7d935..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersBackupSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; - -/** - * Samples for CloudHsmClusters Backup. - */ -public final class CloudHsmClustersBackupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Create_Backup_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterCreateBackupMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .backup("rgcloudhsm", "chsm1", - new BackupRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withToken("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateSamples.java deleted file mode 100644 index c624bf724d84f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateSamples.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.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CloudHsmClusters CreateOrUpdate. - */ -public final class CloudHsmClustersCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterCreateOrUpdateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .define("chsm1") - .withRegion("eastus2") - .withExistingResourceGroup("rgcloudhsm") - .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1", - new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1)) - .withProperties(new CloudHsmClusterProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersDeleteSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersDeleteSamples.java deleted file mode 100644 index d38b150ab02b5..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersDeleteSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusters Delete. - */ -public final class CloudHsmClustersDeleteSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Delete_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterDeleteMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().delete("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupSamples.java deleted file mode 100644 index 7572dc18392c9..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupSamples.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.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusters GetByResourceGroup. - */ -public final class CloudHsmClustersGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Get_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterGetMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .getByResourceGroupWithResponse("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupSamples.java deleted file mode 100644 index 37bfa5fb9312f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusters ListByResourceGroup. - */ -public final class CloudHsmClustersListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterListByResourceGroupMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().listByResourceGroup("rgcloudhsm", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListSamples.java deleted file mode 100644 index 42fe53507e17f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -/** - * Samples for CloudHsmClusters List. - */ -public final class CloudHsmClustersListSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ListBySubscription_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterListBySubscriptionMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters().list(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersRestoreSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersRestoreSamples.java deleted file mode 100644 index 21a2eaa578fff..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersRestoreSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; - -/** - * Samples for CloudHsmClusters Restore. - */ -public final class CloudHsmClustersRestoreSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Restore_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterRestoreMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .restore("rgcloudhsm", "chsm1", - new RestoreRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withBackupId("backupId"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersUpdateSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersUpdateSamples.java deleted file mode 100644 index 1e6c569a72dbc..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersUpdateSamples.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for CloudHsmClusters Update. - */ -public final class CloudHsmClustersUpdateSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_Update_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterUpdateMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - CloudHsmCluster resource = manager.cloudHsmClusters() - .getByResourceGroupWithResponse("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("Dept", "hsm", "Environment", "dogfood", "Slice", "A")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1", - new UserAssignedIdentity()))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateBackupPropertiesSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateBackupPropertiesSamples.java deleted file mode 100644 index a51c70ddf3260..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateBackupPropertiesSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.BackupRequestProperties; - -/** - * Samples for CloudHsmClusters ValidateBackupProperties. - */ -public final class CloudHsmClustersValidateBackupPropertiesSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ValidateBackup_Validation_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterValidateBackupValidationMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .validateBackupProperties("rgcloudhsm", "chsm1", - new BackupRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withToken("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateRestorePropertiesSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateRestorePropertiesSamples.java deleted file mode 100644 index 3eb73306b71d2..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersValidateRestorePropertiesSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.resourcemanager.hardwaresecuritymodules.models.RestoreRequestProperties; - -/** - * Samples for CloudHsmClusters ValidateRestoreProperties. - */ -public final class CloudHsmClustersValidateRestorePropertiesSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmCluster_ValidateRestore_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterValidateRestoreMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.cloudHsmClusters() - .validateRestoreProperties("rgcloudhsm", "chsm1", - new RestoreRequestProperties() - .withAzureStorageBlobContainerUri( - "https://myaccount.blob.core.windows.net/sascontainer/sasContainer") - .withBackupId("backupId"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmCreateOrUpdateSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmCreateOrUpdateSamples.java index 71ca47fa8f4ae..66e00f592f43e 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmCreateOrUpdateSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmCreateOrUpdateSamples.java @@ -20,8 +20,8 @@ public final class DedicatedHsmCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json */ /** * Sample code: Create a new or update an existing payment HSM with management profile. @@ -34,23 +34,23 @@ public static void createANewOrUpdateAnExistingPaymentHSMWithManagementProfile( .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) - .withManagementNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withManagementNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.2")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .create(); } /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_CreateOrUpdate.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_CreateOrUpdate.json */ /** * Sample code: Create a new or update an existing dedicated HSM. @@ -63,20 +63,20 @@ public static void createANewOrUpdateAnExistingDedicatedHSM( .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) .create(); } /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_CreateOrUpdate.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_CreateOrUpdate.json */ /** * Sample code: Create a new or update an existing payment HSM. @@ -89,13 +89,13 @@ public static void createANewOrUpdateAnExistingPaymentHSM( .define("hsm1") .withRegion("westus") .withExistingResourceGroup("hsm-group") - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId( + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("1.0.0.1")))) .withStampId("stamp01")) .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60)) .create(); } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmDeleteSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmDeleteSamples.java index d23c3e085bcce..5f4823f601218 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmDeleteSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmDeleteSamples.java @@ -10,8 +10,8 @@ public final class DedicatedHsmDeleteSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Delete.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Delete.json */ /** * Sample code: Delete a dedicated HSM. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmGetByResourceGroupSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmGetByResourceGroupSamples.java index f9a3c3f2f171d..df9a38ce96cad 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmGetByResourceGroupSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class DedicatedHsmGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Get.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Get.json */ /** * Sample code: Get a payment HSM. @@ -25,8 +25,8 @@ public final class DedicatedHsmGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json */ /** * Sample code: Get a payment HSM with 2018-10-31Preview api version. @@ -40,8 +40,8 @@ public static void getAPaymentHSMWith20181031PreviewApiVersion( /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Get.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Get.json */ /** * Sample code: Get a dedicated HSM. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListByResourceGroupSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListByResourceGroupSamples.java index add37fadc589a..b399aced202a3 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListByResourceGroupSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class DedicatedHsmListByResourceGroupSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_ListByResourceGroup.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_ListByResourceGroup.json */ /** * Sample code: List dedicated HSM devices in a resource group. @@ -25,8 +25,8 @@ public static void listDedicatedHSMDevicesInAResourceGroup( /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_ListByResourceGroup.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_ListByResourceGroup.json */ /** * Sample code: List dedicated HSM devices in a resource group including payment HSM. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples.java index 81fe971839856..56f53251405ee 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples.java @@ -10,8 +10,8 @@ public final class DedicatedHsmListOutboundNetworkDependenciesEndpointsSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/GetOutboundNetworkDependenciesEndpointsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/GetOutboundNetworkDependenciesEndpointsList.json */ /** * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListSamples.java index f7963bb74da62..43db5682a7c46 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListSamples.java @@ -10,8 +10,8 @@ public final class DedicatedHsmListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_ListBySubscription.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_ListBySubscription.json */ /** * Sample code: List dedicated HSM devices in a subscription including payment HSM. @@ -25,8 +25,8 @@ public static void listDedicatedHSMDevicesInASubscriptionIncludingPaymentHSM( /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_ListBySubscription.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_ListBySubscription.json */ /** * Sample code: List dedicated HSM devices in a subscription. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmUpdateSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmUpdateSamples.java index c89fc2b68eb6e..811a7ccbba528 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmUpdateSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmUpdateSamples.java @@ -14,8 +14,8 @@ public final class DedicatedHsmUpdateSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/DedicatedHsm_Update.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_Update.json */ /** * Sample code: Update an existing dedicated HSM. @@ -32,8 +32,8 @@ public static void updateAnExistingDedicatedHSM( /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/PaymentHsm_Update.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_Update.json */ /** * Sample code: Update an existing payment HSM. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListSamples.java index 6b24f31f2ff4c..121b74952e5ea 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListSamples.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/OperationsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/PaymentHsm_OperationsList.json */ /** * Sample code: Get a list of Payment HSM operations. @@ -25,8 +25,8 @@ public static void getAListOfPaymentHSMOperations( /* * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/OperationsList.json + * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/ + * examples/DedicatedHsm_OperationsList.json */ /** * Sample code: Get a list of Dedicated HSM operations. diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterSamples.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterSamples.java deleted file mode 100644 index dd1ba00c19f21..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/samples/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterSamples.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.hardwaresecuritymodules.generated; - -/** - * Samples for PrivateEndpointConnections ListByCloudHsmCluster. - */ -public final class PrivateEndpointConnectionsListByCloudHsmClusterSamples { - /* - * x-ms-original-file: - * specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30- - * preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json - */ - /** - * Sample code: CloudHsmClusterPrivateEndpointConnection_ListByResource_MaximumSet_Gen. - * - * @param manager Entry point to HardwareSecurityModulesManager. - */ - public static void cloudHsmClusterPrivateEndpointConnectionListByResourceMaximumSetGen( - com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager manager) { - manager.privateEndpointConnections() - .listByCloudHsmCluster("rgcloudhsm", "chsm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ApiEntityReferenceTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ApiEntityReferenceTests.java index ce9e18c4bc24e..481faab882f46 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ApiEntityReferenceTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ApiEntityReferenceTests.java @@ -11,15 +11,14 @@ public final class ApiEntityReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApiEntityReference model - = BinaryData.fromString("{\"resourceId\":\"txon\"}").toObject(ApiEntityReference.class); - Assertions.assertEquals("txon", model.resourceId()); + ApiEntityReference model = BinaryData.fromString("{\"id\":\"e\"}").toObject(ApiEntityReference.class); + Assertions.assertEquals("e", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApiEntityReference model = new ApiEntityReference().withResourceId("txon"); + ApiEntityReference model = new ApiEntityReference().withId("e"); model = BinaryData.fromObject(model).toObject(ApiEntityReference.class); - Assertions.assertEquals("txon", model.resourceId()); + Assertions.assertEquals("e", model.id()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterInnerTests.java deleted file mode 100644 index 0dd98de8fe1d4..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterInnerTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterInner model = BinaryData.fromString( - "{\"properties\":{\"activationState\":\"NotDefined\",\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"hsms\":[{\"fqdn\":\"xpyb\",\"state\":\"m\",\"stateMessage\":\"mtz\"},{\"fqdn\":\"bsphrupidgsybbe\",\"state\":\"ph\",\"stateMessage\":\"cmsxaobhdxbm\"},{\"fqdn\":\"ioq\",\"state\":\"ehtbm\",\"stateMessage\":\"p\"},{\"fqdn\":\"noi\",\"state\":\"wlrxyb\",\"stateMessage\":\"oqijgkdmbpaz\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"pdznrbtcqqjnqgl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ufo\",\"actionsRequired\":\"jywif\"},\"provisioningState\":\"Updating\",\"groupIds\":[\"agdfmglzlh\",\"xrifkwmrvkts\"]},\"etag\":\"nt\",\"id\":\"ipa\",\"name\":\"uajpsquc\",\"type\":\"poyfdkfogkn\"}],\"provisioningState\":\"Provisioning\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"ddeqsrdeupewnwre\"},\"identity\":{\"principalId\":\"e6f3b0fc-7765-4770-b9d3-28bef99ca047\",\"tenantId\":\"f1edb6c2-05f2-43ac-a348-9ba0aa321293\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"arhmofcqhsmy\":{\"principalId\":\"368cf8e2-e16b-4dee-ae02-698271e7b9ec\",\"clientId\":\"1da83571-3174-4dc9-8118-a0de4752b832\"},\"dtmlxhekuksjt\":{\"principalId\":\"57da1088-189f-40d5-8969-2a039126e5d8\",\"clientId\":\"dd648353-2188-4d0f-a87d-b490ad5606d5\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":857832438},\"location\":\"arcryuanzwuxzdxt\",\"tags\":{\"u\":\"lhmwhfpmrqobm\"},\"id\":\"knryrtihfxtij\",\"name\":\"pzvgnwzsymglzufc\",\"type\":\"zk\"}") - .toObject(CloudHsmClusterInner.class); - Assertions.assertEquals("arcryuanzwuxzdxt", model.location()); - Assertions.assertEquals("lhmwhfpmrqobm", model.tags().get("u")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.sku().name()); - Assertions.assertEquals(857832438, model.sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - model.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterInner model = new CloudHsmClusterInner().withLocation("arcryuanzwuxzdxt") - .withTags(mapOf("u", "lhmwhfpmrqobm")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("arhmofcqhsmy", new UserAssignedIdentity(), "dtmlxhekuksjt", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1) - .withCapacity(857832438)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterInner.class); - Assertions.assertEquals("arcryuanzwuxzdxt", model.location()); - Assertions.assertEquals("lhmwhfpmrqobm", model.tags().get("u")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.sku().name()); - Assertions.assertEquals(857832438, model.sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - model.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterListResultTests.java deleted file mode 100644 index d84996a70e77a..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterListResultTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.CloudHsmClusterInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterListResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"activationState\":\"Unknown\",\"autoGeneratedDomainNameLabelScope\":\"ResourceGroupReuse\",\"hsms\":[{\"fqdn\":\"uvfqawrlyxwj\",\"state\":\"prbnwbxgjvtbv\",\"stateMessage\":\"sszdnru\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"muouqfp\",\"id\":\"zw\",\"name\":\"nguitnwuizgazxu\",\"type\":\"izuckyfihrfidfvz\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"uht\",\"id\":\"wisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"rpymzidnsez\",\"id\":\"tbzsgfyccs\",\"name\":\"ewmdw\",\"type\":\"jeiachboosfl\"}],\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"pteehzzv\"},\"identity\":{\"principalId\":\"ca0ccc5a-17df-4b93-b176-678da6c002f3\",\"tenantId\":\"04c56ab4-227e-4699-99de-8de78208627e\",\"type\":\"None\",\"userAssignedIdentities\":{\"npvswjdkirso\":{\"principalId\":\"db3993c6-ba8c-49d7-8722-c0f9ae3e21e3\",\"clientId\":\"6ff05cf6-90c7-4d2b-8181-8d0d6ec067a9\"},\"xhcr\":{\"principalId\":\"64e9f9e0-c705-4710-8146-bcf6d5a49e09\",\"clientId\":\"4627484f-ffe2-44eb-b4c9-d3f5b78c088e\"},\"hjtckwhd\":{\"principalId\":\"b9e44681-7407-45ee-870c-8e44e542be60\",\"clientId\":\"4830d8a7-d977-45d0-962c-7975e4a6a7be\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard B10\",\"capacity\":614073164},\"location\":\"pjxsqwpgrjbznor\",\"tags\":{\"xqabnmocpcysh\":\"vsnb\"},\"id\":\"rzafbljjgpbtoqcj\",\"name\":\"klj\",\"type\":\"vbqid\"},{\"properties\":{\"activationState\":\"Failed\",\"autoGeneratedDomainNameLabelScope\":\"ResourceGroupReuse\",\"hsms\":[{\"fqdn\":\"kudjkrlkhb\",\"state\":\"fepgzgq\",\"stateMessage\":\"zloc\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"ierhhbcsglummaj\",\"id\":\"aodxo\",\"name\":\"nbdxk\",\"type\":\"pxokajionp\"}],\"provisioningState\":\"Failed\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"txgcpodgmaajr\"},\"identity\":{\"principalId\":\"e992c130-0d74-4921-9002-ceebd83f2a0f\",\"tenantId\":\"568fceed-32e5-4377-91be-09990e99b669\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"vmclw\":{\"principalId\":\"9707be32-73cf-42aa-a312-0ab89eea2683\",\"clientId\":\"0ec50a80-d15e-45ac-a6aa-b634373a1fca\"},\"coejctbzaqs\":{\"principalId\":\"10328ff6-8a54-4e4b-a889-1758e4b80f31\",\"clientId\":\"66ba282c-603f-4f38-b858-e197cc838ebc\"},\"cbkbfkg\":{\"principalId\":\"d35a0207-8de4-44c7-bc24-848f9140d46f\",\"clientId\":\"997c4e5b-9149-4625-8b16-786e4859566f\"},\"kexxppof\":{\"principalId\":\"ec209cd0-a7be-4597-a5af-ea54d02f66ca\",\"clientId\":\"c1e52043-2e34-42e6-ae28-1bf550b114fe\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":1757077121},\"location\":\"pg\",\"tags\":{\"zxibqeoj\":\"ocjjxhvpmouexh\"},\"id\":\"xqbzvddntwnd\",\"name\":\"icbtwnpzao\",\"type\":\"vuhrhcffcyddgl\"},{\"properties\":{\"activationState\":\"NotActivated\",\"autoGeneratedDomainNameLabelScope\":\"ResourceGroupReuse\",\"hsms\":[{\"fqdn\":\"yeicxmqciwqvhk\",\"state\":\"xuigdtopbobj\",\"stateMessage\":\"hm\"},{\"fqdn\":\"u\",\"state\":\"a\",\"stateMessage\":\"rzayv\"},{\"fqdn\":\"pgvdf\",\"state\":\"otkftutqxlngx\",\"stateMessage\":\"fgugnxkrxdqmid\"},{\"fqdn\":\"hzrvqd\",\"state\":\"bhj\",\"stateMessage\":\"igeho\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"skanyk\",\"id\":\"lcuiywgqywgndr\",\"name\":\"ynhz\",\"type\":\"pphrcgynco\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"cfvmmco\",\"id\":\"sxlzevgbmqj\",\"name\":\"abcypmivk\",\"type\":\"lzu\"}],\"provisioningState\":\"Canceled\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"fnba\"},\"identity\":{\"principalId\":\"5b22be15-16c5-41b5-ae8b-2edcf1b2af8c\",\"tenantId\":\"1e0a310b-7ec1-4a55-a422-c1ec419045fb\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"etqgtzxdpnq\":{\"principalId\":\"a57a9f2a-555b-4608-80cc-d355c0aae5d7\",\"clientId\":\"21d44bcd-b98b-4498-9c37-c126a7514e54\"},\"wxrjfeallnwsub\":{\"principalId\":\"8f3af57b-aa84-4312-a125-b17a4d809741\",\"clientId\":\"bc7fc0dd-8075-4005-ac42-913ec6e08ef7\"},\"jampmngnzscxaqw\":{\"principalId\":\"0f43144f-6b26-4523-8a13-f63ae667ab26\",\"clientId\":\"41d906a1-9091-4f78-9b2b-423e7daca8ef\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard B10\",\"capacity\":1989312604},\"location\":\"nqvpkvlrxnje\",\"tags\":{\"bdlwtgrhpdjpj\":\"ipheoflokeyyien\",\"lhbxxhejjzzvdud\":\"masxazjpqyegu\",\"pwlbjnpg\":\"wdslfhotwmcy\",\"nltyfsoppusuesnz\":\"cftadeh\"},\"id\":\"dejbavo\",\"name\":\"xzdmohctb\",\"type\":\"vudwx\"},{\"properties\":{\"activationState\":\"NotActivated\",\"autoGeneratedDomainNameLabelScope\":\"NoReuse\",\"hsms\":[{\"fqdn\":\"jjugwdkcglhslaz\",\"state\":\"yggdtjixh\",\"stateMessage\":\"uofqwe\"},{\"fqdn\":\"hmenevfyexfwhybc\",\"state\":\"vyvdcs\",\"stateMessage\":\"ynnaam\"},{\"fqdn\":\"ctehfiqscjey\",\"state\":\"hezrkgq\",\"stateMessage\":\"jrefovgmkqsle\"},{\"fqdn\":\"vxyqjpkcattpngjc\",\"state\":\"czsqpjhvm\",\"stateMessage\":\"jvnysounqe\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"etag\":\"eupfhyhltrpm\",\"id\":\"jmcmatuokthfu\",\"name\":\"uaodsfcpk\",\"type\":\"xodpuozmyzydagfu\"}],\"provisioningState\":\"Provisioning\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"iu\"},\"identity\":{\"principalId\":\"e43728c6-d6a7-4662-8519-e8870a6227c2\",\"tenantId\":\"36dbb646-81ab-438e-a94e-db076d12a69d\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"wz\":{\"principalId\":\"49db23d6-e64c-4104-893d-a837e6140d67\",\"clientId\":\"8e0b5b12-28f3-4185-a162-7609ca484b4f\"},\"sm\":{\"principalId\":\"a9737ed0-da1c-476e-9664-0fa99c6b8113\",\"clientId\":\"2d044000-eb28-44b4-820e-336552f526f1\"},\"reximoryocfs\":{\"principalId\":\"c0291226-8795-467e-8fc6-97026630bf42\",\"clientId\":\"5ec25694-2ffc-487c-8f55-800e6d1ef837\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":1143177413},\"location\":\"ys\",\"tags\":{\"nbpoczvyifqrvkdv\":\"iuxhqyudxorr\"},\"id\":\"sllr\",\"name\":\"vvdfwatkpnpul\",\"type\":\"xxbczwtr\"}],\"nextLink\":\"iqzbq\"}") - .toObject(CloudHsmClusterListResult.class); - Assertions.assertEquals("pjxsqwpgrjbznor", model.value().get(0).location()); - Assertions.assertEquals("vsnb", model.value().get(0).tags().get("xqabnmocpcysh")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.value().get(0).sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B10, model.value().get(0).sku().name()); - Assertions.assertEquals(614073164, model.value().get(0).sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE, - model.value().get(0).properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("iqzbq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterListResult model - = new CloudHsmClusterListResult().withValue(Arrays.asList( - new CloudHsmClusterInner().withLocation("pjxsqwpgrjbznor") - .withTags(mapOf("xqabnmocpcysh", "vsnb")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("npvswjdkirso", new UserAssignedIdentity(), "xhcr", - new UserAssignedIdentity(), "hjtckwhd", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B10) - .withCapacity(614073164)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)), - new CloudHsmClusterInner().withLocation("pg") - .withTags(mapOf("zxibqeoj", "ocjjxhvpmouexh")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("vmclw", new UserAssignedIdentity(), "coejctbzaqs", new UserAssignedIdentity(), - "cbkbfkg", new UserAssignedIdentity(), "kexxppof", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1) - .withCapacity(1757077121)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)), - new CloudHsmClusterInner().withLocation("nqvpkvlrxnje") - .withTags(mapOf("bdlwtgrhpdjpj", "ipheoflokeyyien", "lhbxxhejjzzvdud", "masxazjpqyegu", "pwlbjnpg", - "wdslfhotwmcy", "nltyfsoppusuesnz", "cftadeh")) - .withIdentity(new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("etqgtzxdpnq", new UserAssignedIdentity(), "wxrjfeallnwsub", - new UserAssignedIdentity(), "jampmngnzscxaqw", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B10) - .withCapacity(1989312604)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)), - new CloudHsmClusterInner().withLocation("ys") - .withTags(mapOf("nbpoczvyifqrvkdv", "iuxhqyudxorr")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("wz", new UserAssignedIdentity(), "sm", - new UserAssignedIdentity(), "reximoryocfs", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1) - .withCapacity(1143177413)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.NO_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)))) - .withNextLink("iqzbq"); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterListResult.class); - Assertions.assertEquals("pjxsqwpgrjbznor", model.value().get(0).location()); - Assertions.assertEquals("vsnb", model.value().get(0).tags().get("xqabnmocpcysh")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.value().get(0).sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B10, model.value().get(0).sku().name()); - Assertions.assertEquals(614073164, model.value().get(0).sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE, - model.value().get(0).properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("iqzbq", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPatchParametersTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPatchParametersTests.java deleted file mode 100644 index 86408153053cb..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPatchParametersTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterPatchParameters; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterPatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterPatchParameters model = BinaryData.fromString( - "{\"tags\":{\"wtmutduq\":\"b\",\"spwgcuertumkdosv\":\"ta\"},\"identity\":{\"principalId\":\"747bb49d-bd96-4723-837c-c9f19760a313\",\"tenantId\":\"82a0617d-fee1-4007-84d9-a240f872542a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"jfddgmbmbe\":{\"principalId\":\"ec0f8d59-2512-4c73-be25-7bdeaa77aaba\",\"clientId\":\"e171d199-ff3e-43eb-a105-7456d6bb9779\"},\"bhtqqrolfpfpsa\":{\"principalId\":\"a61f964a-eab5-4c41-ae43-987c52d1a201\",\"clientId\":\"f58efe16-aaef-4506-9d2d-10dc237fb2c6\"},\"qux\":{\"principalId\":\"8018da93-a049-4ae2-ad37-f754eb1ffebf\",\"clientId\":\"837b181c-917e-4736-bc1c-8daeb1ec9efb\"},\"yjgzjaoyfhrtxiln\":{\"principalId\":\"73631669-5d93-44d9-b2ae-e4b400e88ba1\",\"clientId\":\"2a2f2e3f-59fa-4f49-82e4-8d702be56e3b\"}}}}") - .toObject(CloudHsmClusterPatchParameters.class); - Assertions.assertEquals("b", model.tags().get("wtmutduq")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterPatchParameters model - = new CloudHsmClusterPatchParameters().withTags(mapOf("wtmutduq", "b", "spwgcuertumkdosv", "ta")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("jfddgmbmbe", new UserAssignedIdentity(), "bhtqqrolfpfpsa", - new UserAssignedIdentity(), "qux", new UserAssignedIdentity(), "yjgzjaoyfhrtxiln", - new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterPatchParameters.class); - Assertions.assertEquals("b", model.tags().get("wtmutduq")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithRespMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithRespMockTests.java deleted file mode 100644 index 7b5d20297567f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsCreateWithRespMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CloudHsmClusterPrivateEndpointConnectionsCreateWithRespMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"ixkwmyijejveg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"nai\",\"actionsRequired\":\"xccbdreaxhcex\"},\"provisioningState\":\"Canceled\",\"groupIds\":[\"ahqkg\",\"tpwijnh\",\"jsvfycxzbfvoowv\",\"vmtgjqppy\"]},\"etag\":\"tronzmyhgfi\",\"id\":\"sxkm\",\"name\":\"waekrrjreafxtsgu\",\"type\":\"hjglikk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response - = manager.cloudHsmClusterPrivateEndpointConnections() - .define("tmtdhtmdvypgik") - .withExistingCloudHsmCluster("htjsying", "fq") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("qaatjinrv") - .withActionsRequired("upmfiibfg"))) - .withEtag("zuhbxvvyhgsopb") - .create(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nai", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xccbdreaxhcex", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("tronzmyhgfi", response.etag()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 646e2823c90cc..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CloudHsmClusterPrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"jguq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"gzlvdnkfxu\",\"actionsRequired\":\"mdwzrmuhapfcqdps\"},\"provisioningState\":\"InternalError\",\"groupIds\":[\"svuo\",\"mgccelvezrypq\",\"mfe\"]},\"etag\":\"erqwkyhkobopg\",\"id\":\"dkow\",\"name\":\"pbqpcrfkbwccsn\",\"type\":\"vcdwxlpqekftn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.cloudHsmClusterPrivateEndpointConnections() - .getWithResponse("nvyq", "atkzwpcnpw", "cjaesgvvs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gzlvdnkfxu", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("mdwzrmuhapfcqdps", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("erqwkyhkobopg", response.etag()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPropertiesTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPropertiesTests.java deleted file mode 100644 index ff36488c96fd4..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterProperties model = BinaryData.fromString( - "{\"activationState\":\"NotActivated\",\"autoGeneratedDomainNameLabelScope\":\"SubscriptionReuse\",\"hsms\":[{\"fqdn\":\"ufhfcbjysa\",\"state\":\"th\",\"stateMessage\":\"hab\"},{\"fqdn\":\"pikxwczbyscnpqxu\",\"state\":\"vyq\",\"stateMessage\":\"wby\"},{\"fqdn\":\"k\",\"state\":\"dumjgrtfwvuk\",\"stateMessage\":\"audccsnhs\"},{\"fqdn\":\"nyejhkryhtnap\",\"state\":\"wlokjyem\",\"stateMessage\":\"vnipjox\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"ejspodmail\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"h\",\"actionsRequired\":\"wyahuxinpmqnja\"},\"provisioningState\":\"Updating\",\"groupIds\":[\"sprozvcput\",\"gjvw\",\"fdatsc\"]},\"etag\":\"vpjhulsuuv\",\"id\":\"jozkrwfndiod\",\"name\":\"pslwejdpvw\",\"type\":\"yoqpsoaccta\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"j\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"cr\",\"actionsRequired\":\"fdfdosygexpa\"},\"provisioningState\":\"Creating\",\"groupIds\":[\"msbzjhcrz\",\"vdphlxaolthqtr\",\"qjbpfzfsin\",\"gvfcj\"]},\"etag\":\"zoxxjtf\",\"id\":\"luwfzitonpeqfpjk\",\"name\":\"lxofpdvhpfxxypin\",\"type\":\"nmayhuybb\"}],\"provisioningState\":\"Deleting\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"ooginuvamih\"}") - .toObject(CloudHsmClusterProperties.class); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.SUBSCRIPTION_REUSE, - model.autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterProperties model = new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.SUBSCRIPTION_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterProperties.class); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.SUBSCRIPTION_REUSE, - model.autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterResourceTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterResourceTests.java deleted file mode 100644 index 93734f085d28d..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterResourceTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterResource; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterResource model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"ac046cb0-40cd-4d03-8d9b-3427c6549226\",\"tenantId\":\"424db395-5900-471e-8314-3a7d19c568a1\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"wrwjfeu\":{\"principalId\":\"ff384d3a-b09c-4fcf-811a-e92846a89cd5\",\"clientId\":\"f953f2e5-29a9-43a8-8ee8-c0e684da236a\"},\"utjeltmrldhugj\":{\"principalId\":\"7a25acea-97ff-460f-ad8f-1919051afad7\",\"clientId\":\"22b0ab50-bc6f-486a-9b26-d0e0a304371c\"},\"atqxho\":{\"principalId\":\"47313b91-ba55-43ea-bdf6-882b4fe685e8\",\"clientId\":\"408e999b-8f72-44a9-8355-204222ade739\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":274751337},\"location\":\"gphuticndvka\",\"tags\":{\"ftyxolniw\":\"yiftyhxhuro\",\"ryplwckbasyypn\":\"wcukjfkgiawxk\",\"phejkotynqgoulz\":\"dhsgcba\"},\"id\":\"dlikwyqkgfgibma\",\"name\":\"gakeqsr\",\"type\":\"yb\"}") - .toObject(CloudHsmClusterResource.class); - Assertions.assertEquals("gphuticndvka", model.location()); - Assertions.assertEquals("yiftyhxhuro", model.tags().get("ftyxolniw")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.sku().name()); - Assertions.assertEquals(274751337, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterResource model = new CloudHsmClusterResource().withLocation("gphuticndvka") - .withTags( - mapOf("ftyxolniw", "yiftyhxhuro", "ryplwckbasyypn", "wcukjfkgiawxk", "phejkotynqgoulz", "dhsgcba")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("wrwjfeu", new UserAssignedIdentity(), "utjeltmrldhugj", - new UserAssignedIdentity(), "atqxho", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1) - .withCapacity(274751337)); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterResource.class); - Assertions.assertEquals("gphuticndvka", model.location()); - Assertions.assertEquals("yiftyhxhuro", model.tags().get("ftyxolniw")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.sku().name()); - Assertions.assertEquals(274751337, model.sku().capacity()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterSkuTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterSkuTests.java deleted file mode 100644 index 52cbc0a333f7f..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterSkuTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmClusterSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmClusterSku model - = BinaryData.fromString("{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":1490924581}") - .toObject(CloudHsmClusterSku.class); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.name()); - Assertions.assertEquals(1490924581, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmClusterSku model = new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B1) - .withCapacity(1490924581); - model = BinaryData.fromObject(model).toObject(CloudHsmClusterSku.class); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, model.family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, model.name()); - Assertions.assertEquals(1490924581, model.capacity()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateMockTests.java deleted file mode 100644 index 9c04af4f1d971..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersCreateOrUpdateMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSku; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -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 reactor.core.publisher.Mono; - -public final class CloudHsmClustersCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"activationState\":\"NotDefined\",\"autoGeneratedDomainNameLabelScope\":\"ResourceGroupReuse\",\"hsms\":[{\"fqdn\":\"q\",\"state\":\"krribdeibqi\",\"stateMessage\":\"kghv\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"InternalError\",\"groupIds\":[\"fajpjorwk\",\"nyhgbijtji\"]},\"etag\":\"xzsjabib\",\"id\":\"stawfsdjpvkv\",\"name\":\"bjxbkzbzk\",\"type\":\"vncjabudurgk\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\",\"groupIds\":[\"jjklff\",\"mouwqlgzrfzeey\"]},\"etag\":\"izikayuhq\",\"id\":\"jbsybbqw\",\"name\":\"vtldgmfpgvmpip\",\"type\":\"slthaq\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\",\"groupIds\":[\"twbdsrezpdrhn\"]},\"etag\":\"yowqkdwytisibir\",\"id\":\"pikpz\",\"name\":\"mejzanlfzxia\",\"type\":\"rmbzo\"}],\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"jq\"},\"identity\":{\"principalId\":\"28e2ac88-0d70-484e-b859-12a8b8522b93\",\"tenantId\":\"6ad153ea-acca-4a05-8c48-21e21ac60f72\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"azszrnwoiindfpw\":{\"principalId\":\"c328cad1-d0b7-408b-9501-0192a517cf2e\",\"clientId\":\"dfb48cb6-3a9f-489a-b0e8-e80e9d0629a3\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":341013341},\"location\":\"lhflsjcdhszfjvf\",\"tags\":{\"hldvriii\":\"feljagrqm\"},\"id\":\"jnalghf\",\"name\":\"vtvsexsowueluq\",\"type\":\"hahhxvrhmzkwpj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CloudHsmCluster response = manager.cloudHsmClusters() - .define("sbrgz") - .withRegion("wzxltjc") - .withExistingResourceGroup("ai") - .withTags(mapOf("xqi", "ltiugcxnavv")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("l", new UserAssignedIdentity(), "hfwpracstwit", - new UserAssignedIdentity(), "evxccedcp", new UserAssignedIdentity()))) - .withSku(new CloudHsmClusterSku().withFamily(CloudHsmClusterSkuFamily.B) - .withName(CloudHsmClusterSkuName.STANDARD_B10) - .withCapacity(1994704768)) - .withProperties(new CloudHsmClusterProperties() - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.NO_REUSE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) - .create(); - - Assertions.assertEquals("lhflsjcdhszfjvf", response.location()); - Assertions.assertEquals("feljagrqm", response.tags().get("hldvriii")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, response.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, response.sku().name()); - Assertions.assertEquals(341013341, response.sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.RESOURCE_GROUP_REUSE, - response.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.properties().publicNetworkAccess()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 3a0a408af7db9..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CloudHsmClustersGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"activationState\":\"Active\",\"autoGeneratedDomainNameLabelScope\":\"SubscriptionReuse\",\"hsms\":[{\"fqdn\":\"uwsyrsndsytgadg\",\"state\":\"aeaeneqnzarrw\",\"stateMessage\":\"uu\"},{\"fqdn\":\"fqka\",\"state\":\"wiipfpub\",\"stateMessage\":\"bwwift\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"sgplsakn\",\"n\"]},\"etag\":\"ynl\",\"id\":\"huopxodlqiynto\",\"name\":\"zihleosjswsr\",\"type\":\"slyzrpzbchckqq\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\",\"groupIds\":[\"suiizynkedyat\",\"wyhqmibzyhwits\",\"ypyynpcdpumnzg\",\"wznm\"]},\"etag\":\"iknsorgjh\",\"id\":\"ldtlwwr\",\"name\":\"kdmtncvokotll\",\"type\":\"d\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"InternalError\",\"groupIds\":[\"ogjltdtbnnhad\",\"ocrkvcikh\",\"vpa\"]},\"etag\":\"gxqquezik\",\"id\":\"ggxkallatmelwuip\",\"name\":\"ccjzkzivgvv\",\"type\":\"nayrhyrnxxmueedn\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\",\"groupIds\":[\"wq\",\"tchealmf\",\"tdaaygdvwvg\"]},\"etag\":\"ohgwxrtfudxepxg\",\"id\":\"agvrvmnpkuk\",\"name\":\"himdbl\",\"type\":\"gwimfn\"}],\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"mszkkfo\"},\"identity\":{\"principalId\":\"dc46539d-aa96-49ff-9615-e2586ba5df0b\",\"tenantId\":\"2076415c-8d21-460e-826b-0b9464865b97\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"fjawneaivxwczel\":{\"principalId\":\"fb0cb8f2-51f5-4415-852a-b98d44615e60\",\"clientId\":\"63e0a780-718c-48b1-bd3d-62f471ea9327\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":2047901217},\"location\":\"feaenwab\",\"tags\":{\"dxbjhwuaanozj\":\"kl\"},\"id\":\"sphyoulpjrvxa\",\"name\":\"l\",\"type\":\"vimjwos\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CloudHsmCluster response = manager.cloudHsmClusters() - .getByResourceGroupWithResponse("ymkcdyhb", "kkpwdreqnovvq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("feaenwab", response.location()); - Assertions.assertEquals("kl", response.tags().get("dxbjhwuaanozj")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, response.sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, response.sku().name()); - Assertions.assertEquals(2047901217, response.sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.SUBSCRIPTION_REUSE, - response.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.properties().publicNetworkAccess()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupMockTests.java deleted file mode 100644 index 9cc1f26adb380..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListByResourceGroupMockTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CloudHsmClustersListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"activationState\":\"NotActivated\",\"autoGeneratedDomainNameLabelScope\":\"SubscriptionReuse\",\"hsms\":[{\"fqdn\":\"ekkezzikhlyfjh\",\"state\":\"qgge\",\"stateMessage\":\"unygaeqid\"},{\"fqdn\":\"fatpxllrxcyjmoa\",\"state\":\"uvarmywdmjsjq\",\"stateMessage\":\"hhyxxrw\"},{\"fqdn\":\"co\",\"state\":\"hp\",\"stateMessage\":\"kgymareqnajxqug\"},{\"fqdn\":\"ky\",\"state\":\"beddgssofw\",\"stateMessage\":\"zqalkrmnjijpx\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\",\"groupIds\":[\"yxbaaabjyvayf\",\"imrzrtuzqog\",\"exn\"]},\"etag\":\"fdnw\",\"id\":\"mewzsyyc\",\"name\":\"uzsoi\",\"type\":\"judpfrxt\"}],\"provisioningState\":\"Failed\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"ytdw\"},\"identity\":{\"principalId\":\"ea9d7319-e8d6-43d7-afaa-8647debc1c26\",\"tenantId\":\"f20d87e5-5cab-43ba-87a4-2529536ca5b9\",\"type\":\"None\",\"userAssignedIdentities\":{\"xhexiilivpdti\":{\"principalId\":\"731043b3-e027-4654-bfff-1f934225f1ee\",\"clientId\":\"ecfc5e12-3909-4f81-aceb-9b93e8c104ae\"},\"tdqoaxoruzfgsq\":{\"principalId\":\"795c9e8d-e697-4fb6-b942-244650bbeef1\",\"clientId\":\"6525932f-3d75-4dfc-939b-0264a7a67e81\"},\"xrxxlep\":{\"principalId\":\"8b1d89e3-22d4-4d3e-b571-d313842852f3\",\"clientId\":\"90655dde-eab0-4923-a1b0-483eab82df3e\"},\"mxjezwlw\":{\"principalId\":\"4719af2c-6bb3-4a3d-9ea6-e62a5aeffec8\",\"clientId\":\"37138478-ec1b-48e7-a995-38695cc56573\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard_B1\",\"capacity\":1402038644},\"location\":\"vydypatdoo\",\"tags\":{\"oo\":\"kniod\",\"ujhemmsbvdkcrodt\":\"bw\"},\"id\":\"infwjlfltkacjve\",\"name\":\"kdlfoa\",\"type\":\"ggkfpagaowpul\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.cloudHsmClusters().listByResourceGroup("tx", "tcs", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vydypatdoo", response.iterator().next().location()); - Assertions.assertEquals("kniod", response.iterator().next().tags().get("oo")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, response.iterator().next().sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B1, response.iterator().next().sku().name()); - Assertions.assertEquals(1402038644, response.iterator().next().sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.SUBSCRIPTION_REUSE, - response.iterator().next().properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, - response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListMockTests.java deleted file mode 100644 index 517c44e23a666..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClustersListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmCluster; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuFamily; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmClusterSkuName; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PublicNetworkAccess; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CloudHsmClustersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"activationState\":\"NotActivated\",\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"hsms\":[{\"fqdn\":\"gxsds\",\"state\":\"e\",\"stateMessage\":\"sbzkf\"},{\"fqdn\":\"eyvpnqicvinvkj\",\"state\":\"dxrbuukzcle\",\"stateMessage\":\"hmlwpaztzpo\"},{\"fqdn\":\"cckwyfzqwhxxbu\",\"state\":\"a\",\"stateMessage\":\"feqztppriol\"},{\"fqdn\":\"rjaltolmncw\",\"state\":\"bqwcsdbnwdcf\",\"stateMessage\":\"cqdpfuv\"}],\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\",\"groupIds\":[\"vxb\",\"t\"]},\"etag\":\"dut\",\"id\":\"ormrlxqtvcofudfl\",\"name\":\"kgjubgdknnqvsazn\",\"type\":\"n\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\",\"groupIds\":[\"sahmky\",\"grauwjuetaebur\",\"vdmovsmzlxwabm\",\"oefki\"]},\"etag\":\"vtpuqujmqlgk\",\"id\":\"tndoaongbjc\",\"name\":\"tujitcjedft\",\"type\":\"waezkojvd\"}],\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"statusMessage\":\"ouicybxarzgszu\"},\"identity\":{\"principalId\":\"9446c581-19e6-45ac-9cf3-9dce9a2a6136\",\"tenantId\":\"752bd869-6a6e-4a22-ac33-de95b27655a9\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"doamciodhkha\":{\"principalId\":\"5f0eb727-0a05-4fbb-a773-52bae2042533\",\"clientId\":\"ab50cd43-32a2-4ed7-ae1a-8c886dd95d40\"},\"hnzbonl\":{\"principalId\":\"bbb06f02-cfdf-45e7-b1f5-31e24e8f957d\",\"clientId\":\"a69d7034-ac6a-4735-8278-fed076254666\"},\"oegokdwbwh\":{\"principalId\":\"e49fc2f5-26bf-4c40-812d-bf2ba44ce931\",\"clientId\":\"d13ec133-b367-49b6-8b24-893364f12e4e\"}}},\"sku\":{\"family\":\"B\",\"name\":\"Standard B10\",\"capacity\":793958832},\"location\":\"vexztvbtqgs\",\"tags\":{\"wtl\":\"oyzko\",\"uximerqfobw\":\"nguxawqaldsy\"},\"id\":\"znkbykutwpfhpagm\",\"name\":\"r\",\"type\":\"kdsnfdsdoakgtdl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.cloudHsmClusters().list("qblylsyxkqj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vexztvbtqgs", response.iterator().next().location()); - Assertions.assertEquals("oyzko", response.iterator().next().tags().get("wtl")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals(CloudHsmClusterSkuFamily.B, response.iterator().next().sku().family()); - Assertions.assertEquals(CloudHsmClusterSkuName.STANDARD_B10, response.iterator().next().sku().name()); - Assertions.assertEquals(793958832, response.iterator().next().sku().capacity()); - Assertions.assertEquals(AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - response.iterator().next().properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, - response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmPropertiesTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmPropertiesTests.java deleted file mode 100644 index 24c7f225f2e2d..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.CloudHsmProperties; -import org.junit.jupiter.api.Assertions; - -public final class CloudHsmPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudHsmProperties model - = BinaryData.fromString("{\"fqdn\":\"gnarxzxtheo\",\"state\":\"si\",\"stateMessage\":\"evcciqihnhun\"}") - .toObject(CloudHsmProperties.class); - Assertions.assertEquals("gnarxzxtheo", model.fqdn()); - Assertions.assertEquals("si", model.state()); - Assertions.assertEquals("evcciqihnhun", model.stateMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudHsmProperties model - = new CloudHsmProperties().withFqdn("gnarxzxtheo").withState("si").withStateMessage("evcciqihnhun"); - model = BinaryData.fromObject(model).toObject(CloudHsmProperties.class); - Assertions.assertEquals("gnarxzxtheo", model.fqdn()); - Assertions.assertEquals("si", model.state()); - Assertions.assertEquals("evcciqihnhun", model.stateMessage()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmInnerTests.java index 2499f91f52025..e08bbcb615a95 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmInnerTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmInnerTests.java @@ -21,50 +21,49 @@ public final class DedicatedHsmInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DedicatedHsmInner model = BinaryData.fromString( - "{\"sku\":{\"name\":\"payShield10K_LMK2_CPS60\"},\"zones\":[\"vnotyfjfcnj\",\"k\",\"nxdhbt\",\"kphywpnvjto\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"mclfplphoxuscr\"},\"networkInterfaces\":[{\"resourceId\":\"ye\",\"privateIpAddress\":\"bjtazqugxywpmu\"},{\"resourceId\":\"fjz\",\"privateIpAddress\":\"qkqujidsu\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"bglaocqxtccm\"},\"networkInterfaces\":[{\"resourceId\":\"xy\",\"privateIpAddress\":\"moyrxvwfudwpz\"},{\"resourceId\":\"xhdzhlrqjbhckf\",\"privateIpAddress\":\"hrxsbk\"},{\"resourceId\":\"pycanuzbpz\",\"privateIpAddress\":\"fkuwbcrnwbmehhse\"}]},\"stampId\":\"jusrtslhspk\",\"statusMessage\":\"emaofmxagkvt\",\"provisioningState\":\"Succeeded\"},\"location\":\"qkrhahvljua\",\"tags\":{\"ualaexqpvfadmw\":\"uhcdhm\",\"vgomz\":\"rcrgvx\",\"bnbbeldawkz\":\"fmisg\"},\"id\":\"ali\",\"name\":\"urqhaka\",\"type\":\"hashsfwxosow\"}") + "{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"dbihanufhfcbj\"},\"networkInterfaces\":[{\"id\":\"ithxqhabifpi\",\"privateIpAddress\":\"wczbys\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"x\"},\"networkInterfaces\":[{\"id\":\"y\",\"privateIpAddress\":\"iwbybrkxvdumjg\"},{\"id\":\"fwvuk\",\"privateIpAddress\":\"audccsnhs\"},{\"id\":\"nyejhkryhtnap\",\"privateIpAddress\":\"wlokjyem\"},{\"id\":\"vnipjox\",\"privateIpAddress\":\"nchgej\"}]},\"stampId\":\"odmailzyd\",\"statusMessage\":\"o\",\"provisioningState\":\"Succeeded\"},\"sku\":{\"name\":\"payShield10K_LMK2_CPS250\"},\"zones\":[\"npmqnjaqwixjspro\"],\"location\":\"vcputegj\",\"tags\":{\"dvpjhulsuuvmk\":\"fdatsc\",\"jdpvwryo\":\"ozkrwfndiodjpslw\",\"hbcryffdfdosyge\":\"psoacctazakljl\"},\"id\":\"paojakhmsbzjh\",\"name\":\"rzevdphlxaol\",\"type\":\"hqtrgqjbpf\"}") .toObject(DedicatedHsmInner.class); - Assertions.assertEquals("qkrhahvljua", model.location()); - Assertions.assertEquals("uhcdhm", model.tags().get("ualaexqpvfadmw")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS60, model.sku().name()); - Assertions.assertEquals("vnotyfjfcnj", model.zones().get(0)); - Assertions.assertEquals("mclfplphoxuscr", model.properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("bjtazqugxywpmu", + Assertions.assertEquals("vcputegj", model.location()); + Assertions.assertEquals("fdatsc", model.tags().get("dvpjhulsuuvmk")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS250, model.sku().name()); + Assertions.assertEquals("npmqnjaqwixjspro", model.zones().get(0)); + Assertions.assertEquals("dbihanufhfcbj", model.properties().networkProfile().subnet().id()); + Assertions.assertEquals("wczbys", model.properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("bglaocqxtccm", model.properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("moyrxvwfudwpz", + Assertions.assertEquals("x", model.properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("iwbybrkxvdumjg", model.properties().managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("jusrtslhspk", model.properties().stampId()); + Assertions.assertEquals("odmailzyd", model.properties().stampId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DedicatedHsmInner model = new DedicatedHsmInner().withLocation("qkrhahvljua") - .withTags(mapOf("ualaexqpvfadmw", "uhcdhm", "vgomz", "rcrgvx", "bnbbeldawkz", "fmisg")) - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS60)) - .withZones(Arrays.asList("vnotyfjfcnj", "k", "nxdhbt", "kphywpnvjto")) + DedicatedHsmInner model = new DedicatedHsmInner().withLocation("vcputegj") + .withTags( + mapOf("dvpjhulsuuvmk", "fdatsc", "jdpvwryo", "ozkrwfndiodjpslw", "hbcryffdfdosyge", "psoacctazakljl")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS250)) + .withZones(Arrays.asList("npmqnjaqwixjspro")) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile(new NetworkProfile() - .withSubnet(new ApiEntityReference().withResourceId("mclfplphoxuscr")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("bjtazqugxywpmu"), - new NetworkInterface().withPrivateIpAddress("qkqujidsu")))) - .withManagementNetworkProfile(new NetworkProfile() - .withSubnet(new ApiEntityReference().withResourceId("bglaocqxtccm")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("moyrxvwfudwpz"), - new NetworkInterface().withPrivateIpAddress("hrxsbk"), - new NetworkInterface().withPrivateIpAddress("fkuwbcrnwbmehhse")))) - .withStampId("jusrtslhspk")); + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("dbihanufhfcbj")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("wczbys")))) + .withManagementNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("x")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("iwbybrkxvdumjg"), + new NetworkInterface().withPrivateIpAddress("audccsnhs"), + new NetworkInterface().withPrivateIpAddress("wlokjyem"), + new NetworkInterface().withPrivateIpAddress("nchgej")))) + .withStampId("odmailzyd")); model = BinaryData.fromObject(model).toObject(DedicatedHsmInner.class); - Assertions.assertEquals("qkrhahvljua", model.location()); - Assertions.assertEquals("uhcdhm", model.tags().get("ualaexqpvfadmw")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS60, model.sku().name()); - Assertions.assertEquals("vnotyfjfcnj", model.zones().get(0)); - Assertions.assertEquals("mclfplphoxuscr", model.properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("bjtazqugxywpmu", + Assertions.assertEquals("vcputegj", model.location()); + Assertions.assertEquals("fdatsc", model.tags().get("dvpjhulsuuvmk")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS250, model.sku().name()); + Assertions.assertEquals("npmqnjaqwixjspro", model.zones().get(0)); + Assertions.assertEquals("dbihanufhfcbj", model.properties().networkProfile().subnet().id()); + Assertions.assertEquals("wczbys", model.properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("bglaocqxtccm", model.properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("moyrxvwfudwpz", + Assertions.assertEquals("x", model.properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("iwbybrkxvdumjg", model.properties().managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("jusrtslhspk", model.properties().stampId()); + Assertions.assertEquals("odmailzyd", model.properties().stampId()); } // Use "Map.of" if available diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListResultTests.java index a0af646febe10..64297ce46f435 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListResultTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmListResultTests.java @@ -22,74 +22,71 @@ public final class DedicatedHsmListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DedicatedHsmListResult model = BinaryData.fromString( - "{\"value\":[{\"sku\":{\"name\":\"payShield10K_LMK2_CPS60\"},\"zones\":[\"vah\",\"pjyzhpv\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"j\"},\"networkInterfaces\":[{},{},{}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"lmwlxkvugfhzo\"},\"networkInterfaces\":[{},{},{}]},\"stampId\":\"vzunluthnnprnxi\",\"statusMessage\":\"ilpjzuaejxdult\",\"provisioningState\":\"Allocating\"},\"location\":\"btdzumveekg\",\"tags\":{\"xl\":\"zuhkfpbsjyof\",\"ttouwaboekqvkel\":\"us\"},\"id\":\"smv\",\"name\":\"xwyjsflhhc\",\"type\":\"aln\"},{\"sku\":{\"name\":\"payShield10K_LMK2_CPS250\"},\"zones\":[\"xyawj\",\"yaqcslyjpkiidz\",\"exznelixhnr\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"lhbnxkna\"},\"networkInterfaces\":[{},{},{},{}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"ggdtpnapnyiro\"},\"networkInterfaces\":[{},{}]},\"stampId\":\"igvpgylg\",\"statusMessage\":\"itxmedjvcslynqww\",\"provisioningState\":\"Connecting\"},\"location\":\"zhxgktrmgucn\",\"tags\":{\"oellwp\":\"t\"},\"id\":\"fdygpfqbuaceopz\",\"name\":\"qrhhu\",\"type\":\"opppcqeq\"},{\"sku\":{\"name\":\"payShield10K_LMK2_CPS60\"},\"zones\":[\"ahzxctobgbk\",\"moizpos\",\"mgrcfbu\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"qjhhkxbpv\"},\"networkInterfaces\":[{}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"xjyngudivk\"},\"networkInterfaces\":[{},{}]},\"stampId\":\"bxqz\",\"statusMessage\":\"zjf\",\"provisioningState\":\"CheckingQuota\"},\"location\":\"fdxxivetvtcqaqtd\",\"tags\":{\"fxoblytkb\":\"cbxvwvxyslqbh\",\"wfbkrvrns\":\"mpew\",\"vasrruvwb\":\"shqjohxcrsbf\"},\"id\":\"sqfsubcgjbirxb\",\"name\":\"ybsrfbjfdtwss\",\"type\":\"t\"}],\"nextLink\":\"pvjzbe\"}") + "{\"value\":[{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"yhxhu\"},\"networkInterfaces\":[{}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"xolniwpwcukjfk\"},\"networkInterfaces\":[{},{}]},\"stampId\":\"xklrypl\",\"statusMessage\":\"kbasyypn\",\"provisioningState\":\"Deleting\"},\"sku\":{\"name\":\"payShield10K_LMK2_CPS2500\"},\"zones\":[\"cph\",\"jkot\",\"nqgoulzndli\"],\"location\":\"wyqkgfgibm\",\"tags\":{\"xybz\":\"akeqs\",\"mnkzsmod\":\"qedqytbciqfoufl\"},\"id\":\"glougpbk\",\"name\":\"tmut\",\"type\":\"uqktap\"},{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"uertumk\"},\"networkInterfaces\":[{},{},{},{}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"hbmdgbbjfdd\"},\"networkInterfaces\":[{},{},{},{}]},\"stampId\":\"bexppb\",\"statusMessage\":\"q\",\"provisioningState\":\"Deleting\"},\"sku\":{\"name\":\"SafeNet Luna Network HSM A790\"},\"zones\":[\"s\",\"lgbquxig\",\"yjgzjaoyfhrtxiln\"],\"location\":\"rkujy\",\"tags\":{\"fqawrlyxw\":\"eju\"},\"id\":\"kcprbnw\",\"name\":\"xgjvtbv\",\"type\":\"ysszdnrujqguh\"},{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"f\"},\"networkInterfaces\":[{},{},{}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"nguitnwuizgazxu\"},\"networkInterfaces\":[{},{}]},\"stampId\":\"ckyfih\",\"statusMessage\":\"idf\",\"provisioningState\":\"Allocating\"},\"sku\":{\"name\":\"SafeNet Luna Network HSM A790\"},\"zones\":[\"ymwisdkft\"],\"location\":\"wxmnteiwao\",\"tags\":{\"pymzidnsezcxtbzs\":\"mijcmmxdcufufs\"},\"id\":\"fycc\",\"name\":\"newmdwzjeiachbo\",\"type\":\"sflnrosfqp\"}],\"nextLink\":\"ehzzvypyqrim\"}") .toObject(DedicatedHsmListResult.class); - Assertions.assertEquals("btdzumveekg", model.value().get(0).location()); - Assertions.assertEquals("zuhkfpbsjyof", model.value().get(0).tags().get("xl")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS60, model.value().get(0).sku().name()); - Assertions.assertEquals("vah", model.value().get(0).zones().get(0)); - Assertions.assertEquals("j", model.value().get(0).properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("lmwlxkvugfhzo", - model.value().get(0).properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("vzunluthnnprnxi", model.value().get(0).properties().stampId()); - Assertions.assertEquals("pvjzbe", model.nextLink()); + Assertions.assertEquals("wyqkgfgibm", model.value().get(0).location()); + Assertions.assertEquals("akeqs", model.value().get(0).tags().get("xybz")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS2500, model.value().get(0).sku().name()); + Assertions.assertEquals("cph", model.value().get(0).zones().get(0)); + Assertions.assertEquals("yhxhu", model.value().get(0).properties().networkProfile().subnet().id()); + Assertions.assertEquals("xolniwpwcukjfk", + model.value().get(0).properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("xklrypl", model.value().get(0).properties().stampId()); + Assertions.assertEquals("ehzzvypyqrim", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DedicatedHsmListResult model - = new DedicatedHsmListResult().withValue(Arrays.asList( - new DedicatedHsmInner() - .withLocation("btdzumveekg") - .withTags(mapOf("xl", "zuhkfpbsjyof", "ttouwaboekqvkel", "us")) - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS60)) - .withZones(Arrays.asList("vah", "pjyzhpv")) + DedicatedHsmListResult model = new DedicatedHsmListResult() + .withValue(Arrays.asList( + new DedicatedHsmInner().withLocation("wyqkgfgibm") + .withTags(mapOf("xybz", "akeqs", "mnkzsmod", "qedqytbciqfoufl")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS2500)) + .withZones(Arrays.asList("cph", "jkot", "nqgoulzndli")) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("j")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface(), - new NetworkInterface()))) - .withManagementNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("lmwlxkvugfhzo")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface(), - new NetworkInterface()))) - .withStampId("vzunluthnnprnxi")), - new DedicatedHsmInner().withLocation("zhxgktrmgucn") - .withTags(mapOf("oellwp", "t")) - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS250)) - .withZones(Arrays.asList("xyawj", "yaqcslyjpkiidz", "exznelixhnr")) + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("yhxhu")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface()))) + .withManagementNetworkProfile(new NetworkProfile() + .withSubnet(new ApiEntityReference().withId("xolniwpwcukjfk")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface()))) + .withStampId("xklrypl")), + new DedicatedHsmInner().withLocation("rkujy") + .withTags(mapOf("fqawrlyxw", "eju")) + .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) + .withZones(Arrays.asList("s", "lgbquxig", "yjgzjaoyfhrtxiln")) .withProperties(new DedicatedHsmProperties() - .withNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("lhbnxkna")) + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("uertumk")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface(), + new NetworkInterface(), new NetworkInterface()))) + .withManagementNetworkProfile( + new NetworkProfile().withSubnet(new ApiEntityReference().withId("hbmdgbbjfdd")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface(), new NetworkInterface(), new NetworkInterface()))) - .withManagementNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("ggdtpnapnyiro")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface()))) - .withStampId("igvpgylg")), - new DedicatedHsmInner().withLocation("fdxxivetvtcqaqtd") - .withTags(mapOf("fxoblytkb", "cbxvwvxyslqbh", "wfbkrvrns", "mpew", "vasrruvwb", "shqjohxcrsbf")) - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS60)) - .withZones(Arrays.asList("ahzxctobgbk", "moizpos", "mgrcfbu")) - .withProperties(new DedicatedHsmProperties() - .withNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("qjhhkxbpv")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface()))) - .withManagementNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("xjyngudivk")) + .withStampId("bexppb")), + new DedicatedHsmInner().withLocation("wxmnteiwao") + .withTags(mapOf("pymzidnsezcxtbzs", "mijcmmxdcufufs")) + .withSku(new Sku().withName(SkuName.SAFE_NET_LUNA_NETWORK_HSM_A790)) + .withZones(Arrays.asList("ymwisdkft")) + .withProperties( + new DedicatedHsmProperties() + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("f")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface(), + new NetworkInterface()))) + .withManagementNetworkProfile(new NetworkProfile() + .withSubnet(new ApiEntityReference().withId("nguitnwuizgazxu")) .withNetworkInterfaces(Arrays.asList(new NetworkInterface(), new NetworkInterface()))) - .withStampId("bxqz")))) - .withNextLink("pvjzbe"); + .withStampId("ckyfih")))) + .withNextLink("ehzzvypyqrim"); model = BinaryData.fromObject(model).toObject(DedicatedHsmListResult.class); - Assertions.assertEquals("btdzumveekg", model.value().get(0).location()); - Assertions.assertEquals("zuhkfpbsjyof", model.value().get(0).tags().get("xl")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS60, model.value().get(0).sku().name()); - Assertions.assertEquals("vah", model.value().get(0).zones().get(0)); - Assertions.assertEquals("j", model.value().get(0).properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("lmwlxkvugfhzo", - model.value().get(0).properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("vzunluthnnprnxi", model.value().get(0).properties().stampId()); - Assertions.assertEquals("pvjzbe", model.nextLink()); + Assertions.assertEquals("wyqkgfgibm", model.value().get(0).location()); + Assertions.assertEquals("akeqs", model.value().get(0).tags().get("xybz")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS2500, model.value().get(0).sku().name()); + Assertions.assertEquals("cph", model.value().get(0).zones().get(0)); + Assertions.assertEquals("yhxhu", model.value().get(0).properties().networkProfile().subnet().id()); + Assertions.assertEquals("xolniwpwcukjfk", + model.value().get(0).properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("xklrypl", model.value().get(0).properties().stampId()); + Assertions.assertEquals("ehzzvypyqrim", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationDisplayTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationDisplayTests.java new file mode 100644 index 0000000000000..d7671c9e89e1e --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationDisplayTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedHsmOperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedHsmOperationDisplay model = BinaryData.fromString( + "{\"provider\":\"uxzdxtay\",\"resource\":\"hmwhfpmrqo\",\"operation\":\"tu\",\"description\":\"nryrtihf\"}") + .toObject(DedicatedHsmOperationDisplay.class); + Assertions.assertEquals("uxzdxtay", model.provider()); + Assertions.assertEquals("hmwhfpmrqo", model.resource()); + Assertions.assertEquals("tu", model.operation()); + Assertions.assertEquals("nryrtihf", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedHsmOperationDisplay model = new DedicatedHsmOperationDisplay().withProvider("uxzdxtay") + .withResource("hmwhfpmrqo") + .withOperation("tu") + .withDescription("nryrtihf"); + model = BinaryData.fromObject(model).toObject(DedicatedHsmOperationDisplay.class); + Assertions.assertEquals("uxzdxtay", model.provider()); + Assertions.assertEquals("hmwhfpmrqo", model.resource()); + Assertions.assertEquals("tu", model.operation()); + Assertions.assertEquals("nryrtihf", model.description()); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationInnerTests.java new file mode 100644 index 0000000000000..ef02aa29e3d09 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationInnerTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedHsmOperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedHsmOperationInner model = BinaryData.fromString( + "{\"name\":\"itjz\",\"isDataAction\":false,\"origin\":\"sarhmofc\",\"display\":{\"provider\":\"my\",\"resource\":\"kdtmlxhekuk\",\"operation\":\"txukcdmp\",\"description\":\"cryuan\"}}") + .toObject(DedicatedHsmOperationInner.class); + Assertions.assertEquals("itjz", model.name()); + Assertions.assertEquals("sarhmofc", model.origin()); + Assertions.assertEquals("my", model.display().provider()); + Assertions.assertEquals("kdtmlxhekuk", model.display().resource()); + Assertions.assertEquals("txukcdmp", model.display().operation()); + Assertions.assertEquals("cryuan", model.display().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedHsmOperationInner model = new DedicatedHsmOperationInner().withName("itjz") + .withOrigin("sarhmofc") + .withDisplay(new DedicatedHsmOperationDisplay().withProvider("my") + .withResource("kdtmlxhekuk") + .withOperation("txukcdmp") + .withDescription("cryuan")); + model = BinaryData.fromObject(model).toObject(DedicatedHsmOperationInner.class); + Assertions.assertEquals("itjz", model.name()); + Assertions.assertEquals("sarhmofc", model.origin()); + Assertions.assertEquals("my", model.display().provider()); + Assertions.assertEquals("kdtmlxhekuk", model.display().resource()); + Assertions.assertEquals("txukcdmp", model.display().operation()); + Assertions.assertEquals("cryuan", model.display().description()); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationListResultTests.java new file mode 100644 index 0000000000000..ef93556221666 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmOperationListResultTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.DedicatedHsmOperationInner; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperationListResult; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedHsmOperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedHsmOperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"origin\":\"opb\",\"display\":{\"provider\":\"rupidgsyb\",\"resource\":\"jhphoyc\",\"operation\":\"xaobhdxbmtqioqjz\",\"description\":\"tbmufpo\"}},{\"name\":\"oizh\",\"isDataAction\":false,\"origin\":\"ybqsoqijg\",\"display\":{\"provider\":\"bpazlobcufpdzn\",\"resource\":\"t\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"}},{\"name\":\"lhjxr\",\"isDataAction\":false,\"origin\":\"mrvktsizntoc\",\"display\":{\"provider\":\"ouajpsqucmpoyf\",\"resource\":\"fogknygjofjdde\",\"operation\":\"rd\",\"description\":\"pewnw\"}}]}") + .toObject(DedicatedHsmOperationListResult.class); + Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); + Assertions.assertEquals("opb", model.value().get(0).origin()); + Assertions.assertEquals("rupidgsyb", model.value().get(0).display().provider()); + Assertions.assertEquals("jhphoyc", model.value().get(0).display().resource()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.value().get(0).display().operation()); + Assertions.assertEquals("tbmufpo", model.value().get(0).display().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedHsmOperationListResult model = new DedicatedHsmOperationListResult().withValue(Arrays.asList( + new DedicatedHsmOperationInner().withName("quvgjxpybczme") + .withOrigin("opb") + .withDisplay(new DedicatedHsmOperationDisplay().withProvider("rupidgsyb") + .withResource("jhphoyc") + .withOperation("xaobhdxbmtqioqjz") + .withDescription("tbmufpo")), + new DedicatedHsmOperationInner().withName("oizh") + .withOrigin("ybqsoqijg") + .withDisplay(new DedicatedHsmOperationDisplay().withProvider("bpazlobcufpdzn") + .withResource("t") + .withOperation("qjnqglhqgnufoooj") + .withDescription("ifsqesaagdfmg")), + new DedicatedHsmOperationInner().withName("lhjxr") + .withOrigin("mrvktsizntoc") + .withDisplay(new DedicatedHsmOperationDisplay().withProvider("ouajpsqucmpoyf") + .withResource("fogknygjofjdde") + .withOperation("rd") + .withDescription("pewnw")))); + model = BinaryData.fromObject(model).toObject(DedicatedHsmOperationListResult.class); + Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); + Assertions.assertEquals("opb", model.value().get(0).origin()); + Assertions.assertEquals("rupidgsyb", model.value().get(0).display().provider()); + Assertions.assertEquals("jhphoyc", model.value().get(0).display().resource()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.value().get(0).display().operation()); + Assertions.assertEquals("tbmufpo", model.value().get(0).display().description()); + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPatchParametersTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPatchParametersTests.java index 255e33846a91a..d3023b8175c7d 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPatchParametersTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPatchParametersTests.java @@ -13,17 +13,18 @@ public final class DedicatedHsmPatchParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DedicatedHsmPatchParameters model = BinaryData.fromString("{\"tags\":{\"bycnojvkn\":\"wroyqbexrmcq\"}}") - .toObject(DedicatedHsmPatchParameters.class); - Assertions.assertEquals("wroyqbexrmcq", model.tags().get("bycnojvkn")); + DedicatedHsmPatchParameters model + = BinaryData.fromString("{\"tags\":{\"tmrldhugjzzdatq\":\"je\",\"gphuticndvka\":\"hocdgeab\"}}") + .toObject(DedicatedHsmPatchParameters.class); + Assertions.assertEquals("je", model.tags().get("tmrldhugjzzdatq")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DedicatedHsmPatchParameters model - = new DedicatedHsmPatchParameters().withTags(mapOf("bycnojvkn", "wroyqbexrmcq")); + = new DedicatedHsmPatchParameters().withTags(mapOf("tmrldhugjzzdatq", "je", "gphuticndvka", "hocdgeab")); model = BinaryData.fromObject(model).toObject(DedicatedHsmPatchParameters.class); - Assertions.assertEquals("wroyqbexrmcq", model.tags().get("bycnojvkn")); + Assertions.assertEquals("je", model.tags().get("tmrldhugjzzdatq")); } // Use "Map.of" if available diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPropertiesTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPropertiesTests.java index c9db508661721..ff3fd3b6b5cb7 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPropertiesTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmPropertiesTests.java @@ -16,31 +16,31 @@ public final class DedicatedHsmPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DedicatedHsmProperties model = BinaryData.fromString( - "{\"networkProfile\":{\"subnet\":{\"resourceId\":\"cjooxdjebwpucwwf\"},\"networkInterfaces\":[{\"resourceId\":\"vmeueci\",\"privateIpAddress\":\"hzceuojgjrwjue\"},{\"resourceId\":\"twm\",\"privateIpAddress\":\"ytdxwit\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"awgqwgxhni\"},\"networkInterfaces\":[{\"resourceId\":\"bkpyc\",\"privateIpAddress\":\"lwn\"}]},\"stampId\":\"hjdauwhvylwz\",\"statusMessage\":\"dhxujznbmpo\",\"provisioningState\":\"Succeeded\"}") + "{\"networkProfile\":{\"subnet\":{\"id\":\"n\"},\"networkInterfaces\":[{\"id\":\"cjrwzoxxjtfellu\",\"privateIpAddress\":\"zitonpeqfpjkjl\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"dvhpfxxypininm\"},\"networkInterfaces\":[{\"id\":\"ybb\",\"privateIpAddress\":\"odepoogin\"}]},\"stampId\":\"amiheognarxz\",\"statusMessage\":\"heotusiv\",\"provisioningState\":\"Deleting\"}") .toObject(DedicatedHsmProperties.class); - Assertions.assertEquals("cjooxdjebwpucwwf", model.networkProfile().subnet().resourceId()); - Assertions.assertEquals("hzceuojgjrwjue", model.networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("awgqwgxhni", model.managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("lwn", model.managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("hjdauwhvylwz", model.stampId()); + Assertions.assertEquals("n", model.networkProfile().subnet().id()); + Assertions.assertEquals("zitonpeqfpjkjl", model.networkProfile().networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("dvhpfxxypininm", model.managementNetworkProfile().subnet().id()); + Assertions.assertEquals("odepoogin", + model.managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("amiheognarxz", model.stampId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DedicatedHsmProperties model = new DedicatedHsmProperties() - .withNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("cjooxdjebwpucwwf")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("hzceuojgjrwjue"), - new NetworkInterface().withPrivateIpAddress("ytdxwit")))) + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("n")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("zitonpeqfpjkjl")))) .withManagementNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("awgqwgxhni")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("lwn")))) - .withStampId("hjdauwhvylwz"); + new NetworkProfile().withSubnet(new ApiEntityReference().withId("dvhpfxxypininm")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("odepoogin")))) + .withStampId("amiheognarxz"); model = BinaryData.fromObject(model).toObject(DedicatedHsmProperties.class); - Assertions.assertEquals("cjooxdjebwpucwwf", model.networkProfile().subnet().resourceId()); - Assertions.assertEquals("hzceuojgjrwjue", model.networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("awgqwgxhni", model.managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("lwn", model.managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("hjdauwhvylwz", model.stampId()); + Assertions.assertEquals("n", model.networkProfile().subnet().id()); + Assertions.assertEquals("zitonpeqfpjkjl", model.networkProfile().networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("dvhpfxxypininm", model.managementNetworkProfile().subnet().id()); + Assertions.assertEquals("odepoogin", + model.managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("amiheognarxz", model.stampId()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmResourceTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmResourceTests.java new file mode 100644 index 0000000000000..f0f4e60047553 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmResourceTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hardwaresecuritymodules.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmResource; +import com.azure.resourcemanager.hardwaresecuritymodules.models.Sku; +import com.azure.resourcemanager.hardwaresecuritymodules.models.SkuName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedHsmResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedHsmResource model = BinaryData.fromString( + "{\"sku\":{\"name\":\"payShield10K_LMK1_CPS2500\"},\"zones\":[\"rljdouskcqv\",\"ocrcjdk\",\"tnhxbn\"],\"location\":\"biksq\",\"tags\":{\"fmppe\":\"ssainqpjwnzll\",\"c\":\"bvmgxsabkyqduuji\"},\"id\":\"czdzev\",\"name\":\"dhkrwpdappdsbdk\",\"type\":\"wrwjfeu\"}") + .toObject(DedicatedHsmResource.class); + Assertions.assertEquals("biksq", model.location()); + Assertions.assertEquals("ssainqpjwnzll", model.tags().get("fmppe")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS2500, model.sku().name()); + Assertions.assertEquals("rljdouskcqv", model.zones().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedHsmResource model = new DedicatedHsmResource().withLocation("biksq") + .withTags(mapOf("fmppe", "ssainqpjwnzll", "c", "bvmgxsabkyqduuji")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS2500)) + .withZones(Arrays.asList("rljdouskcqv", "ocrcjdk", "tnhxbn")); + model = BinaryData.fromObject(model).toObject(DedicatedHsmResource.class); + Assertions.assertEquals("biksq", model.location()); + Assertions.assertEquals("ssainqpjwnzll", model.tags().get("fmppe")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS2500, model.sku().name()); + Assertions.assertEquals("rljdouskcqv", model.zones().get(0)); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsCreateOrUpdateMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsCreateOrUpdateMockTests.java index a6d63a1b0886d..1330ffd96e6c4 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsCreateOrUpdateMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsCreateOrUpdateMockTests.java @@ -30,7 +30,7 @@ public final class DedicatedHsmsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"payShield10K_LMK1_CPS60\"},\"zones\":[\"wzf\",\"tsttktlahbq\",\"ctxtgzukxi\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"tg\"},\"networkInterfaces\":[{\"resourceId\":\"hrnxrxc\",\"privateIpAddress\":\"uisavokq\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"azivjlfrqttbajl\"},\"networkInterfaces\":[{\"resourceId\":\"wxyiopidkqq\",\"privateIpAddress\":\"uvscxkdmligov\"},{\"resourceId\":\"rxkpmloazuruoc\",\"privateIpAddress\":\"oorb\"}]},\"stampId\":\"oybfhjxakvvj\",\"statusMessage\":\"lordilmywwtkgkxn\",\"provisioningState\":\"Succeeded\"},\"location\":\"b\",\"tags\":{\"hxuuwhcjyxccybvp\":\"udtjuewbc\",\"dzpxgwjpl\":\"yakk\",\"yohpfkyrkdbdgiog\":\"agst\",\"nobaiyhddviacegf\":\"jkmnwq\"},\"id\":\"m\",\"name\":\"tfpmvmemfnczdw\",\"type\":\"vbalxlllc\"}"; + = "{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"wpn\"},\"networkInterfaces\":[{\"id\":\"qnermclfplphoxu\",\"privateIpAddress\":\"rpabg\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"bjtazqugxywpmu\"},\"networkInterfaces\":[{\"id\":\"zwfqkqujidsuyon\",\"privateIpAddress\":\"glaocq\"}]},\"stampId\":\"ccm\",\"statusMessage\":\"udxytlmoyrx\",\"provisioningState\":\"Succeeded\"},\"sku\":{\"name\":\"payShield10K_LMK1_CPS250\"},\"zones\":[\"ntxhdzhlrqjbhck\",\"rlhrxs\"],\"location\":\"kyv\",\"tags\":{\"crnwbmeh\":\"anuzbpzkafkuw\"},\"id\":\"seyvj\",\"name\":\"srtslhspkdeem\",\"type\":\"ofmxagkvtmelmqkr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -40,36 +40,33 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); DedicatedHsm response = manager.dedicatedHsms() - .define("pzlrphw") - .withRegion("yo") - .withExistingResourceGroup("kwbqplhlvnuu") - .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS2500)) + .define("fzab") + .withRegion("xotogtwrupqsxv") + .withExistingResourceGroup("xytxhpzxbz") .withProperties(new DedicatedHsmProperties() - .withNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("miloxggdufiqndie")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("ys")))) - .withManagementNetworkProfile( - new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("tcubiipuipwoqonm")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("zshq"), - new NetworkInterface().withPrivateIpAddress("b"), - new NetworkInterface().withPrivateIpAddress("icc")))) - .withStampId("wfscjfn")) - .withTags(mapOf("vutpthjoxo", "lgy", "pi", "smsks", "xkcgxxlxsffgcvi", "lqol")) - .withZones(Arrays.asList("wey", "qdunvmnnrwrbior", "talywjhhgdnhxms")) + .withNetworkProfile(new NetworkProfile().withSubnet(new ApiEntityReference().withId("xwtctyqiklbbovpl")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("kfssxqukkf"), + new NetworkInterface().withPrivateIpAddress("pvlopwiyighxpkd")))) + .withManagementNetworkProfile(new NetworkProfile() + .withSubnet(new ApiEntityReference().withId("iuebbaumny")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("bckhsmtxpsi")))) + .withStampId("tfhvpesapskrdqmh")) + .withTags(mapOf("eil", "cykvceo")) + .withSku(new Sku().withName(SkuName.PAY_SHIELD10K_LMK2_CPS2500)) + .withZones(Arrays.asList("scwsv")) .create(); - Assertions.assertEquals("b", response.location()); - Assertions.assertEquals("udtjuewbc", response.tags().get("hxuuwhcjyxccybvp")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS60, response.sku().name()); - Assertions.assertEquals("wzf", response.zones().get(0)); - Assertions.assertEquals("tg", response.properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("uisavokq", + Assertions.assertEquals("kyv", response.location()); + Assertions.assertEquals("anuzbpzkafkuw", response.tags().get("crnwbmeh")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS250, response.sku().name()); + Assertions.assertEquals("ntxhdzhlrqjbhck", response.zones().get(0)); + Assertions.assertEquals("wpn", response.properties().networkProfile().subnet().id()); + Assertions.assertEquals("rpabg", response.properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("azivjlfrqttbajl", - response.properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("uvscxkdmligov", + Assertions.assertEquals("bjtazqugxywpmu", response.properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("glaocq", response.properties().managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("oybfhjxakvvj", response.properties().stampId()); + Assertions.assertEquals("ccm", response.properties().stampId()); } // Use "Map.of" if available diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsDeleteMockTests.java similarity index 57% rename from sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterMockTests.java rename to sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsDeleteMockTests.java index 9f04800f1760c..3a35306ce2dac 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsDeleteMockTests.java @@ -6,23 +6,19 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResource; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterMockTests { +public final class DedicatedHsmsDeleteMockTests { @Test - public void testListByCloudHsmCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"ujxukndxd\",\"requiredMembers\":[\"jguufzdm\",\"yqtfihwh\",\"otzi\",\"gamv\"],\"requiredZoneNames\":[\"o\"]},\"id\":\"qzudphq\",\"name\":\"mvdk\",\"type\":\"wynwcvtbvkayhm\"}]}"; + public void testDelete() throws Exception { + String responseStr = "{}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +27,7 @@ public void testListByCloudHsmCluster() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.cloudHsmClusterPrivateLinkResources() - .listByCloudHsmCluster("wws", "ughftqsx", com.azure.core.util.Context.NONE); + manager.dedicatedHsms().delete("xnj", "ase", com.azure.core.util.Context.NONE); - Assertions.assertEquals("o", response.iterator().next().properties().requiredZoneNames().get(0)); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsGetByResourceGroupWithResponseMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsGetByResourceGroupWithResponseMockTests.java index 8400b7ef7259a..4fb0ac061196e 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsGetByResourceGroupWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class DedicatedHsmsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"payShield10K_LMK1_CPS250\"},\"zones\":[\"bjx\",\"fw\",\"yl\",\"coolsttpkiwkkb\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"ywvtylbfpnc\"},\"networkInterfaces\":[{\"resourceId\":\"iwii\",\"privateIpAddress\":\"tywubxcbihwq\"},{\"resourceId\":\"fdntwjchrdgoih\",\"privateIpAddress\":\"mwctondzjluudfd\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"ytsbwtovv\"},\"networkInterfaces\":[{\"resourceId\":\"inqfiufxqknpirgn\",\"privateIpAddress\":\"ttwqmsni\"},{\"resourceId\":\"cdm\",\"privateIpAddress\":\"r\"},{\"resourceId\":\"lpijnkrxfrd\",\"privateIpAddress\":\"c\"}]},\"stampId\":\"tizzronasxif\",\"statusMessage\":\"zq\",\"provisioningState\":\"Allocating\"},\"location\":\"tw\",\"tags\":{\"yhmossxkkg\":\"ogczhonnxkrlg\",\"rghxjb\":\"h\",\"rnsvbuswd\":\"hqxvcxgfrpdsofbs\",\"ybycnunvj\":\"z\"},\"id\":\"rtkfawnopq\",\"name\":\"ikyzirtxdy\",\"type\":\"x\"}"; + = "{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"masxazjpqyegu\"},\"networkInterfaces\":[{\"id\":\"xxhejjzzvd\",\"privateIpAddress\":\"gwdslfhotwm\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"wlbjnpgacftade\"},\"networkInterfaces\":[{\"id\":\"tyfsoppusuesn\",\"privateIpAddress\":\"dejbavo\"},{\"id\":\"zdmohctbqvu\",\"privateIpAddress\":\"xdn\"},{\"id\":\"vo\",\"privateIpAddress\":\"ujjugwdkcglh\"},{\"id\":\"azjdyggd\",\"privateIpAddress\":\"ixhbkuofqweykhm\"}]},\"stampId\":\"evfyexfwhybcib\",\"statusMessage\":\"vdcsitynn\",\"provisioningState\":\"Provisioning\"},\"sku\":{\"name\":\"payShield10K_LMK1_CPS2500\"},\"zones\":[\"hfiqscjeypvhe\"],\"location\":\"rkgqhcjrefo\",\"tags\":{\"jpkcattpng\":\"kqsleyyvxy\",\"czsqpjhvm\":\"cr\",\"a\":\"ajvnysounqe\"},\"id\":\"oaeupfhyhltrpmo\",\"name\":\"jmcmatuokthfu\",\"type\":\"uaodsfcpk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,19 +32,19 @@ public void testGetByResourceGroupWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); DedicatedHsm response = manager.dedicatedHsms() - .getByResourceGroupWithResponse("jbypel", "c", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("pheoflokeyy", "enjbdlwtgrhp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("tw", response.location()); - Assertions.assertEquals("ogczhonnxkrlg", response.tags().get("yhmossxkkg")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS250, response.sku().name()); - Assertions.assertEquals("bjx", response.zones().get(0)); - Assertions.assertEquals("ywvtylbfpnc", response.properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("tywubxcbihwq", + Assertions.assertEquals("rkgqhcjrefo", response.location()); + Assertions.assertEquals("kqsleyyvxy", response.tags().get("jpkcattpng")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS2500, response.sku().name()); + Assertions.assertEquals("hfiqscjeypvhe", response.zones().get(0)); + Assertions.assertEquals("masxazjpqyegu", response.properties().networkProfile().subnet().id()); + Assertions.assertEquals("gwdslfhotwm", response.properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("ytsbwtovv", response.properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("ttwqmsni", + Assertions.assertEquals("wlbjnpgacftade", response.properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("dejbavo", response.properties().managementNetworkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("tizzronasxif", response.properties().stampId()); + Assertions.assertEquals("evfyexfwhybcib", response.properties().stampId()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListByResourceGroupMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListByResourceGroupMockTests.java index 4e580979e89e1..eeba61521743a 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListByResourceGroupMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListByResourceGroupMockTests.java @@ -23,7 +23,7 @@ public final class DedicatedHsmsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"payShield10K_LMK2_CPS250\"},\"zones\":[\"oi\",\"qukrydxt\",\"mieoxorgguf\",\"yaomtb\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"vgrvkffo\"},\"networkInterfaces\":[{\"resourceId\":\"pjbi\",\"privateIpAddress\":\"jmfxumvf\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"ovwxnbkfezzxsc\"},\"networkInterfaces\":[{\"resourceId\":\"dgirujbzbom\",\"privateIpAddress\":\"zbtd\"},{\"resourceId\":\"vp\",\"privateIpAddress\":\"yujviylwdshfssn\"},{\"resourceId\":\"gy\",\"privateIpAddress\":\"rymsgaojfmw\"}]},\"stampId\":\"otmrfhir\",\"statusMessage\":\"ymoxoftpipiwyczu\",\"provisioningState\":\"Allocating\"},\"location\":\"pqjlihhyusps\",\"tags\":{\"cvpa\":\"dvlmfwdgzxul\",\"zvxurisjnhny\":\"rsre\",\"hu\":\"xifqjzgxm\",\"cesutrgjupauut\":\"lw\"},\"id\":\"woqhihe\",\"name\":\"qg\",\"type\":\"zpnfqntcypsxj\"}]}"; + = "{\"value\":[{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"iu\"},\"networkInterfaces\":[{\"id\":\"whrdxwzywqsmbsu\",\"privateIpAddress\":\"xim\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"cfsf\"},\"networkInterfaces\":[{\"id\":\"ddystkiiuxhqy\",\"privateIpAddress\":\"xorrqnb\"},{\"id\":\"czvyifq\",\"privateIpAddress\":\"kdvjsll\"}]},\"stampId\":\"vvdfwatkpnpul\",\"statusMessage\":\"xbczwtruwiqz\",\"provisioningState\":\"Allocating\"},\"sku\":{\"name\":\"payShield10K_LMK1_CPS60\"},\"zones\":[\"yokacspkw\",\"hzdobpxjmflbvvnc\",\"rkcciwwzjuqk\"],\"location\":\"rsa\",\"tags\":{\"foskghsauuimj\":\"ku\",\"rfbyaosvexcso\":\"vxieduugidyj\",\"vleggzfbuhfmvfax\":\"pclhocohslk\",\"hl\":\"ffeii\"},\"id\":\"m\",\"name\":\"zy\",\"type\":\"shxmzsbbzoggigrx\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,20 +32,19 @@ public void testListByResourceGroup() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response - = manager.dedicatedHsms().listByResourceGroup("ejnt", 902595467, com.azure.core.util.Context.NONE); + PagedIterable response = manager.dedicatedHsms() + .listByResourceGroup("xodpuozmyzydagfu", 1113167460, com.azure.core.util.Context.NONE); - Assertions.assertEquals("pqjlihhyusps", response.iterator().next().location()); - Assertions.assertEquals("dvlmfwdgzxul", response.iterator().next().tags().get("cvpa")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS250, response.iterator().next().sku().name()); - Assertions.assertEquals("oi", response.iterator().next().zones().get(0)); - Assertions.assertEquals("vgrvkffo", - response.iterator().next().properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("jmfxumvf", + Assertions.assertEquals("rsa", response.iterator().next().location()); + Assertions.assertEquals("ku", response.iterator().next().tags().get("foskghsauuimj")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS60, response.iterator().next().sku().name()); + Assertions.assertEquals("yokacspkw", response.iterator().next().zones().get(0)); + Assertions.assertEquals("iu", response.iterator().next().properties().networkProfile().subnet().id()); + Assertions.assertEquals("xim", response.iterator().next().properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("ovwxnbkfezzxsc", - response.iterator().next().properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("zbtd", + Assertions.assertEquals("cfsf", + response.iterator().next().properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("xorrqnb", response.iterator() .next() .properties() @@ -53,6 +52,6 @@ public void testListByResourceGroup() throws Exception { .networkInterfaces() .get(0) .privateIpAddress()); - Assertions.assertEquals("otmrfhir", response.iterator().next().properties().stampId()); + Assertions.assertEquals("vvdfwatkpnpul", response.iterator().next().properties().stampId()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListMockTests.java index a6ae81a14b0aa..7a8f95c936e32 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListMockTests.java @@ -23,7 +23,7 @@ public final class DedicatedHsmsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"payShield10K_LMK1_CPS60\"},\"zones\":[\"kslircizjxvydfc\",\"acvlhv\"],\"properties\":{\"networkProfile\":{\"subnet\":{\"resourceId\":\"ftumrtwnawjslbiw\"},\"networkInterfaces\":[{\"resourceId\":\"cyztsfmznbaeqp\",\"privateIpAddress\":\"hqnrn\"},{\"resourceId\":\"x\",\"privateIpAddress\":\"uwrykqgaifmvikl\"},{\"resourceId\":\"dvk\",\"privateIpAddress\":\"ejd\"},{\"resourceId\":\"xcv\",\"privateIpAddress\":\"rhnj\"}]},\"managementNetworkProfile\":{\"subnet\":{\"resourceId\":\"v\"},\"networkInterfaces\":[{\"resourceId\":\"qfzgemjdftul\",\"privateIpAddress\":\"tduceamt\"},{\"resourceId\":\"zuo\",\"privateIpAddress\":\"jw\"}]},\"stampId\":\"wqiok\",\"statusMessage\":\"sx\",\"provisioningState\":\"Succeeded\"},\"location\":\"sv\",\"tags\":{\"heyd\":\"prvkwcfzqljyxgtc\"},\"id\":\"sdshmkxmaehvb\",\"name\":\"xu\",\"type\":\"iplt\"}]}"; + = "{\"value\":[{\"properties\":{\"networkProfile\":{\"subnet\":{\"id\":\"xxjnspydptk\"},\"networkInterfaces\":[{\"id\":\"ou\",\"privateIpAddress\":\"vudwtiukbldng\"},{\"id\":\"ocipazyxoeg\",\"privateIpAddress\":\"g\"}]},\"managementNetworkProfile\":{\"subnet\":{\"id\":\"ucgygevqz\"},\"networkInterfaces\":[{\"id\":\"mrbpizcdrqj\",\"privateIpAddress\":\"pyd\"}]},\"stampId\":\"yhxdeoejzicwi\",\"statusMessage\":\"jttgzf\",\"provisioningState\":\"Succeeded\"},\"sku\":{\"name\":\"payShield10K_LMK2_CPS2500\"},\"zones\":[\"ajdeyeamdphaga\",\"pbuxwgipwhon\",\"wkgshwa\",\"kix\"],\"location\":\"bin\",\"tags\":{\"yqzrnkcqvyxlw\":\"uttmrywnuzoqft\"},\"id\":\"zlsico\",\"name\":\"oqqnwvlryav\",\"type\":\"hheunmmqhgyx\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,19 +33,18 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.dedicatedHsms().list(1942763074, com.azure.core.util.Context.NONE); + = manager.dedicatedHsms().list(830818996, com.azure.core.util.Context.NONE); - Assertions.assertEquals("sv", response.iterator().next().location()); - Assertions.assertEquals("prvkwcfzqljyxgtc", response.iterator().next().tags().get("heyd")); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS60, response.iterator().next().sku().name()); - Assertions.assertEquals("kslircizjxvydfc", response.iterator().next().zones().get(0)); - Assertions.assertEquals("ftumrtwnawjslbiw", - response.iterator().next().properties().networkProfile().subnet().resourceId()); - Assertions.assertEquals("hqnrn", + Assertions.assertEquals("bin", response.iterator().next().location()); + Assertions.assertEquals("uttmrywnuzoqft", response.iterator().next().tags().get("yqzrnkcqvyxlw")); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK2_CPS2500, response.iterator().next().sku().name()); + Assertions.assertEquals("ajdeyeamdphaga", response.iterator().next().zones().get(0)); + Assertions.assertEquals("xxjnspydptk", response.iterator().next().properties().networkProfile().subnet().id()); + Assertions.assertEquals("vudwtiukbldng", response.iterator().next().properties().networkProfile().networkInterfaces().get(0).privateIpAddress()); - Assertions.assertEquals("v", - response.iterator().next().properties().managementNetworkProfile().subnet().resourceId()); - Assertions.assertEquals("tduceamt", + Assertions.assertEquals("ucgygevqz", + response.iterator().next().properties().managementNetworkProfile().subnet().id()); + Assertions.assertEquals("pyd", response.iterator() .next() .properties() @@ -53,6 +52,6 @@ public void testList() throws Exception { .networkInterfaces() .get(0) .privateIpAddress()); - Assertions.assertEquals("wqiok", response.iterator().next().properties().stampId()); + Assertions.assertEquals("yhxdeoejzicwi", response.iterator().next().properties().stampId()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListOutboundNetworkDependenciesEndpointsMockTests.java index 99f3d990cef1e..334e656f791f5 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListOutboundNetworkDependenciesEndpointsMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/DedicatedHsmsListOutboundNetworkDependenciesEndpointsMockTests.java @@ -22,7 +22,7 @@ public final class DedicatedHsmsListOutboundNetworkDependenciesEndpointsMockTest @Test public void testListOutboundNetworkDependenciesEndpoints() throws Exception { String responseStr - = "{\"value\":[{\"category\":\"ywrckp\",\"endpoints\":[{\"domainName\":\"hpluodpvruudlg\",\"endpointDetails\":[{\"ipAddress\":\"hostgktstvdxecl\",\"port\":1260615912,\"protocol\":\"bcvhzlhpl\",\"description\":\"qkdlw\"}]},{\"domainName\":\"fbumlkx\",\"endpointDetails\":[{\"ipAddress\":\"fsmlmbtxhwgfw\",\"port\":836535007,\"protocol\":\"wcoezbrhub\",\"description\":\"hud\"},{\"ipAddress\":\"oookkqfq\",\"port\":958097402,\"protocol\":\"eorfm\",\"description\":\"iqtqzfavyvnq\"},{\"ipAddress\":\"bar\",\"port\":1877295480,\"protocol\":\"yjkqabqgzslesjcb\",\"description\":\"rnntiewdjcv\"}]},{\"domainName\":\"uwrbehwagoh\",\"endpointDetails\":[{\"ipAddress\":\"kmr\",\"port\":1538670364,\"protocol\":\"vhmxtdrjfu\",\"description\":\"coebjvewzcj\"}]},{\"domainName\":\"m\",\"endpointDetails\":[{\"ipAddress\":\"guaadraufactkahz\",\"port\":1219742698,\"protocol\":\"j\",\"description\":\"uxxpshne\"},{\"ipAddress\":\"ulfgslqu\",\"port\":471639164,\"protocol\":\"lenrd\",\"description\":\"tujbazpju\"},{\"ipAddress\":\"minyflnorwm\",\"port\":1535649405,\"protocol\":\"pklvxw\",\"description\":\"gdxpg\"},{\"ipAddress\":\"chisze\",\"port\":511466566,\"protocol\":\"jcrxgibbdaxcon\",\"description\":\"zauorsuk\"}]}]}]}"; + = "{\"value\":[{\"category\":\"fkbey\",\"endpoints\":[{\"domainName\":\"mjmwvvjektcx\",\"endpointDetails\":[{\"ipAddress\":\"wlrsffrzpwv\",\"port\":1792150681,\"protocol\":\"gbiqylihkaet\",\"description\":\"tvfcivfsn\"},{\"ipAddress\":\"m\",\"port\":1059821653,\"protocol\":\"hjfbebrjcxe\",\"description\":\"uwutttxfvjrbi\"},{\"ipAddress\":\"hxepcyvahfnlj\",\"port\":561070013,\"protocol\":\"j\",\"description\":\"ujqgidok\"},{\"ipAddress\":\"ljyoxgvcltb\",\"port\":1745548413,\"protocol\":\"ghkjeszzhbi\",\"description\":\"txfvgx\"}]},{\"domainName\":\"smx\",\"endpointDetails\":[{\"ipAddress\":\"pvecxgodeb\",\"port\":398257944,\"protocol\":\"rbmpukgri\",\"description\":\"lzlfbxzpuz\"},{\"ipAddress\":\"ispnqzahmgkbrp\",\"port\":1687540865,\"protocol\":\"ibnuqqkpik\",\"description\":\"rgvtqag\"}]},{\"domainName\":\"uynhijg\",\"endpointDetails\":[{\"ipAddress\":\"fsiarbutr\",\"port\":1477198207,\"protocol\":\"azzmhjrunmpxt\",\"description\":\"bh\"}]},{\"domainName\":\"nlankxmyskpb\",\"endpointDetails\":[{\"ipAddress\":\"tkcxywnytnrsy\",\"port\":1857239406,\"protocol\":\"dybyxczfclhaa\",\"description\":\"babphlwrqlfk\"},{\"ipAddress\":\"thsu\",\"port\":296949281,\"protocol\":\"nyyazttbtwwrqpue\",\"description\":\"kzywbiex\"},{\"ipAddress\":\"eyueaxibxujwb\",\"port\":913520848,\"protocol\":\"lmuzy\",\"description\":\"aepdkzjanc\"},{\"ipAddress\":\"rhdwbavxbniw\",\"port\":1074996435,\"protocol\":\"zt\",\"description\":\"bpg\"}]}]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,17 +32,17 @@ public void testListOutboundNetworkDependenciesEndpoints() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.dedicatedHsms() - .listOutboundNetworkDependenciesEndpoints("n", "tbaxk", com.azure.core.util.Context.NONE); + .listOutboundNetworkDependenciesEndpoints("konocu", "oklyaxuconuq", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ywrckp", response.iterator().next().category()); - Assertions.assertEquals("hpluodpvruudlg", response.iterator().next().endpoints().get(0).domainName()); - Assertions.assertEquals("hostgktstvdxecl", + Assertions.assertEquals("fkbey", response.iterator().next().category()); + Assertions.assertEquals("mjmwvvjektcx", response.iterator().next().endpoints().get(0).domainName()); + Assertions.assertEquals("wlrsffrzpwv", response.iterator().next().endpoints().get(0).endpointDetails().get(0).ipAddress()); - Assertions.assertEquals(1260615912, + Assertions.assertEquals(1792150681, response.iterator().next().endpoints().get(0).endpointDetails().get(0).port()); - Assertions.assertEquals("bcvhzlhpl", + Assertions.assertEquals("gbiqylihkaet", response.iterator().next().endpoints().get(0).endpointDetails().get(0).protocol()); - Assertions.assertEquals("qkdlw", + Assertions.assertEquals("tvfcivfsn", response.iterator().next().endpoints().get(0).endpointDetails().get(0).description()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDependencyTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDependencyTests.java index e7a35e136ea7a..b05d144afc7cb 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDependencyTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDependencyTests.java @@ -14,32 +14,27 @@ public final class EndpointDependencyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointDependency model = BinaryData.fromString( - "{\"domainName\":\"v\",\"endpointDetails\":[{\"ipAddress\":\"lvithhqzonosgg\",\"port\":218924487,\"protocol\":\"hfwdsjnkaljutiis\",\"description\":\"cffgdkzzewk\"},{\"ipAddress\":\"hqcrailvpnpp\",\"port\":1159921712,\"protocol\":\"rwdmhdlxyjrxsa\",\"description\":\"fcnihgwq\"}]}") + "{\"domainName\":\"nc\",\"endpointDetails\":[{\"ipAddress\":\"cfvmmco\",\"port\":734446999,\"protocol\":\"lzevgbmqjqab\",\"description\":\"pmivkwlzu\"}]}") .toObject(EndpointDependency.class); - Assertions.assertEquals("v", model.domainName()); - Assertions.assertEquals("lvithhqzonosgg", model.endpointDetails().get(0).ipAddress()); - Assertions.assertEquals(218924487, model.endpointDetails().get(0).port()); - Assertions.assertEquals("hfwdsjnkaljutiis", model.endpointDetails().get(0).protocol()); - Assertions.assertEquals("cffgdkzzewk", model.endpointDetails().get(0).description()); + Assertions.assertEquals("nc", model.domainName()); + Assertions.assertEquals("cfvmmco", model.endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(734446999, model.endpointDetails().get(0).port()); + Assertions.assertEquals("lzevgbmqjqab", model.endpointDetails().get(0).protocol()); + Assertions.assertEquals("pmivkwlzu", model.endpointDetails().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EndpointDependency model = new EndpointDependency().withDomainName("v") - .withEndpointDetails(Arrays.asList( - new EndpointDetail().withIpAddress("lvithhqzonosgg") - .withPort(218924487) - .withProtocol("hfwdsjnkaljutiis") - .withDescription("cffgdkzzewk"), - new EndpointDetail().withIpAddress("hqcrailvpnpp") - .withPort(1159921712) - .withProtocol("rwdmhdlxyjrxsa") - .withDescription("fcnihgwq"))); + EndpointDependency model = new EndpointDependency().withDomainName("nc") + .withEndpointDetails(Arrays.asList(new EndpointDetail().withIpAddress("cfvmmco") + .withPort(734446999) + .withProtocol("lzevgbmqjqab") + .withDescription("pmivkwlzu"))); model = BinaryData.fromObject(model).toObject(EndpointDependency.class); - Assertions.assertEquals("v", model.domainName()); - Assertions.assertEquals("lvithhqzonosgg", model.endpointDetails().get(0).ipAddress()); - Assertions.assertEquals(218924487, model.endpointDetails().get(0).port()); - Assertions.assertEquals("hfwdsjnkaljutiis", model.endpointDetails().get(0).protocol()); - Assertions.assertEquals("cffgdkzzewk", model.endpointDetails().get(0).description()); + Assertions.assertEquals("nc", model.domainName()); + Assertions.assertEquals("cfvmmco", model.endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(734446999, model.endpointDetails().get(0).port()); + Assertions.assertEquals("lzevgbmqjqab", model.endpointDetails().get(0).protocol()); + Assertions.assertEquals("pmivkwlzu", model.endpointDetails().get(0).description()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDetailTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDetailTests.java index ea2bdda1dcb9c..dd47f1baa8aa2 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDetailTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/EndpointDetailTests.java @@ -12,25 +12,22 @@ public final class EndpointDetailTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointDetail model = BinaryData - .fromString( - "{\"ipAddress\":\"nedgfbc\",\"port\":720554896,\"protocol\":\"q\",\"description\":\"keqdcvdrhvoods\"}") + .fromString("{\"ipAddress\":\"c\",\"port\":1704525857,\"protocol\":\"nbacfi\",\"description\":\"l\"}") .toObject(EndpointDetail.class); - Assertions.assertEquals("nedgfbc", model.ipAddress()); - Assertions.assertEquals(720554896, model.port()); - Assertions.assertEquals("q", model.protocol()); - Assertions.assertEquals("keqdcvdrhvoods", model.description()); + Assertions.assertEquals("c", model.ipAddress()); + Assertions.assertEquals(1704525857, model.port()); + Assertions.assertEquals("nbacfi", model.protocol()); + Assertions.assertEquals("l", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EndpointDetail model = new EndpointDetail().withIpAddress("nedgfbc") - .withPort(720554896) - .withProtocol("q") - .withDescription("keqdcvdrhvoods"); + EndpointDetail model + = new EndpointDetail().withIpAddress("c").withPort(1704525857).withProtocol("nbacfi").withDescription("l"); model = BinaryData.fromObject(model).toObject(EndpointDetail.class); - Assertions.assertEquals("nedgfbc", model.ipAddress()); - Assertions.assertEquals(720554896, model.port()); - Assertions.assertEquals("q", model.protocol()); - Assertions.assertEquals("keqdcvdrhvoods", model.description()); + Assertions.assertEquals("c", model.ipAddress()); + Assertions.assertEquals(1704525857, model.port()); + Assertions.assertEquals("nbacfi", model.protocol()); + Assertions.assertEquals("l", model.description()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ManagedServiceIdentityTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 03a867bb863ad..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentity; -import com.azure.resourcemanager.hardwaresecuritymodules.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"f2ef90bb-94fa-44fa-97df-4c9c97b36a8a\",\"tenantId\":\"b3f17864-ed8e-4434-acaf-4271235af759\",\"type\":\"None\",\"userAssignedIdentities\":{\"bciqfouflm\":{\"principalId\":\"5198cf5e-12f0-4165-96de-ce448b71da56\",\"clientId\":\"c7efade3-94ee-45f1-8a6c-d4cee35ad067\"},\"zsm\":{\"principalId\":\"435c94a0-d1d6-4594-a2da-09c1e6c1f6cf\",\"clientId\":\"f8cb5644-1e74-4e1f-b507-b9accde7106d\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf("bciqfouflm", new UserAssignedIdentity(), "zsm", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkInterfaceTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkInterfaceTests.java index b51144cbee348..cb471f0c621d6 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkInterfaceTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkInterfaceTests.java @@ -12,15 +12,15 @@ public final class NetworkInterfaceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkInterface model - = BinaryData.fromString("{\"resourceId\":\"ts\",\"privateIpAddress\":\"jcbpwxqpsrknft\"}") + = BinaryData.fromString("{\"id\":\"hqjbasvmsmj\",\"privateIpAddress\":\"lngsntnbybkzgcwr\"}") .toObject(NetworkInterface.class); - Assertions.assertEquals("jcbpwxqpsrknft", model.privateIpAddress()); + Assertions.assertEquals("lngsntnbybkzgcwr", model.privateIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NetworkInterface model = new NetworkInterface().withPrivateIpAddress("jcbpwxqpsrknft"); + NetworkInterface model = new NetworkInterface().withPrivateIpAddress("lngsntnbybkzgcwr"); model = BinaryData.fromObject(model).toObject(NetworkInterface.class); - Assertions.assertEquals("jcbpwxqpsrknft", model.privateIpAddress()); + Assertions.assertEquals("lngsntnbybkzgcwr", model.privateIpAddress()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkProfileTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkProfileTests.java index dc0d9f5c8643b..ec929fd18868a 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkProfileTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/NetworkProfileTests.java @@ -15,21 +15,19 @@ public final class NetworkProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkProfile model = BinaryData.fromString( - "{\"subnet\":{\"resourceId\":\"zqlveualupjmkhf\"},\"networkInterfaces\":[{\"resourceId\":\"cswsrtjri\",\"privateIpAddress\":\"rbpbewtghfgblcg\"},{\"resourceId\":\"zvlvqhjkbegib\",\"privateIpAddress\":\"mxiebw\"},{\"resourceId\":\"loayqcgw\",\"privateIpAddress\":\"zjuzgwyz\"}]}") + "{\"subnet\":{\"id\":\"iqihn\"},\"networkInterfaces\":[{\"id\":\"bwjzr\",\"privateIpAddress\":\"ygxgispemvtz\"},{\"id\":\"ufubl\",\"privateIpAddress\":\"fxqeof\"}]}") .toObject(NetworkProfile.class); - Assertions.assertEquals("zqlveualupjmkhf", model.subnet().resourceId()); - Assertions.assertEquals("rbpbewtghfgblcg", model.networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("iqihn", model.subnet().id()); + Assertions.assertEquals("ygxgispemvtz", model.networkInterfaces().get(0).privateIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NetworkProfile model - = new NetworkProfile().withSubnet(new ApiEntityReference().withResourceId("zqlveualupjmkhf")) - .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("rbpbewtghfgblcg"), - new NetworkInterface().withPrivateIpAddress("mxiebw"), - new NetworkInterface().withPrivateIpAddress("zjuzgwyz"))); + NetworkProfile model = new NetworkProfile().withSubnet(new ApiEntityReference().withId("iqihn")) + .withNetworkInterfaces(Arrays.asList(new NetworkInterface().withPrivateIpAddress("ygxgispemvtz"), + new NetworkInterface().withPrivateIpAddress("fxqeof"))); model = BinaryData.fromObject(model).toObject(NetworkProfile.class); - Assertions.assertEquals("zqlveualupjmkhf", model.subnet().resourceId()); - Assertions.assertEquals("rbpbewtghfgblcg", model.networkInterfaces().get(0).privateIpAddress()); + Assertions.assertEquals("iqihn", model.subnet().id()); + Assertions.assertEquals("ygxgispemvtz", model.networkInterfaces().get(0).privateIpAddress()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationDisplayTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationDisplayTests.java deleted file mode 100644 index 97bf3990b14ae..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"erpqlpqwcciuqg\",\"resource\":\"butauvfb\",\"operation\":\"uwhhmhykojoxafn\",\"description\":\"lpichk\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationInnerTests.java deleted file mode 100644 index 230ee9ebed675..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.OperationInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"voqacpiexpbt\",\"isDataAction\":false,\"display\":{\"provider\":\"oenwashr\",\"resource\":\"tkcnqxwb\",\"operation\":\"kulpiujwaasi\",\"description\":\"i\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationListResultTests.java deleted file mode 100644 index 28b4f60a4c162..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"bzdopcj\",\"isDataAction\":true,\"display\":{\"provider\":\"ld\",\"resource\":\"gx\",\"operation\":\"rslpmutwuoeg\",\"description\":\"khjwn\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"i\",\"isDataAction\":true,\"display\":{\"provider\":\"kzzlvmbmpaxmodf\",\"resource\":\"efyw\",\"operation\":\"pfvmwyhrfou\",\"description\":\"taakc\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"qtmnubexkpzk\",\"isDataAction\":false,\"display\":{\"provider\":\"jmquxvypomgk\",\"resource\":\"kwhojvpaj\",\"operation\":\"xysmoc\",\"description\":\"qfqvmkc\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"helxprglya\",\"isDataAction\":false,\"display\":{\"provider\":\"cbcuejrjxgciqi\",\"resource\":\"hos\",\"operation\":\"dqrhzoymib\",\"description\":\"qyib\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"szdtmhrkwof\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListMockTests.java index a1f98d791e01a..8cb034e00ebac 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListMockTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OperationsListMockTests.java @@ -11,9 +11,10 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.Operation; +import com.azure.resourcemanager.hardwaresecuritymodules.models.DedicatedHsmOperation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"odbzevwrdnhf\",\"isDataAction\":false,\"display\":{\"provider\":\"jcswsmys\",\"resource\":\"luqypfcvlerch\",\"operation\":\"bm\",\"description\":\"jbabwidf\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"x\",\"isDataAction\":false,\"origin\":\"tzxdpnqbqqwx\",\"display\":{\"provider\":\"eallnwsubisnj\",\"resource\":\"pmng\",\"operation\":\"scxaq\",\"description\":\"ochcbonqvpkvl\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +31,13 @@ public void testList() throws Exception { .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); + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + Assertions.assertEquals("x", response.iterator().next().name()); + Assertions.assertEquals("tzxdpnqbqqwx", response.iterator().next().origin()); + Assertions.assertEquals("eallnwsubisnj", response.iterator().next().display().provider()); + Assertions.assertEquals("pmng", response.iterator().next().display().resource()); + Assertions.assertEquals("scxaq", response.iterator().next().display().operation()); + Assertions.assertEquals("ochcbonqvpkvl", response.iterator().next().display().description()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointCollectionTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointCollectionTests.java index c9d7ccc18b137..d4e013aceef5a 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointCollectionTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointCollectionTests.java @@ -16,10 +16,10 @@ public final class OutboundEnvironmentEndpointCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OutboundEnvironmentEndpointCollection model = BinaryData.fromString( - "{\"value\":[{\"category\":\"zznfqqnvwpmqta\",\"endpoints\":[{\"domainName\":\"jmkcjhwqytj\",\"endpointDetails\":[{}]},{\"domainName\":\"wj\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"rjerv\",\"endpointDetails\":[{}]},{\"domainName\":\"qp\",\"endpointDetails\":[{},{},{},{}]}]},{\"category\":\"doy\",\"endpoints\":[{\"domainName\":\"thnzd\",\"endpointDetails\":[{}]},{\"domainName\":\"gnayqigynduh\",\"endpointDetails\":[{},{},{}]}]},{\"category\":\"lkthu\",\"endpoints\":[{\"domainName\":\"lbg\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"iertgccymvaolp\",\"endpointDetails\":[{},{}]}]}],\"nextLink\":\"lfmmdnbbglzpswi\"}") + "{\"value\":[{\"category\":\"pvswjdkirso\",\"endpoints\":[{\"domainName\":\"hc\",\"endpointDetails\":[{},{}]},{\"domainName\":\"hjtckwhd\",\"endpointDetails\":[{},{},{},{}]}]},{\"category\":\"iy\",\"endpoints\":[{\"domainName\":\"sqwpgrjb\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"cjxvsnbyxqab\",\"endpointDetails\":[{},{}]},{\"domainName\":\"pcyshu\",\"endpointDetails\":[{},{},{},{}]}]},{\"category\":\"bl\",\"endpoints\":[{\"domainName\":\"btoqcjmkljavbqid\",\"endpointDetails\":[{},{}]},{\"domainName\":\"zyulp\",\"endpointDetails\":[{}]},{\"domainName\":\"krlkhbzhfepg\",\"endpointDetails\":[{}]}]},{\"category\":\"xzlocxscp\",\"endpoints\":[{\"domainName\":\"hhbcsglummajtjao\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"nbdxk\",\"endpointDetails\":[{}]},{\"domainName\":\"kajionpim\",\"endpointDetails\":[{},{}]}]}],\"nextLink\":\"txgcpodgmaajr\"}") .toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("zznfqqnvwpmqta", model.value().get(0).category()); - Assertions.assertEquals("jmkcjhwqytj", model.value().get(0).endpoints().get(0).domainName()); + Assertions.assertEquals("pvswjdkirso", model.value().get(0).category()); + Assertions.assertEquals("hc", model.value().get(0).endpoints().get(0).domainName()); } @org.junit.jupiter.api.Test @@ -28,34 +28,42 @@ public void testSerialize() throws Exception { = new OutboundEnvironmentEndpointCollection() .withValue( Arrays.asList( - new OutboundEnvironmentEndpointInner().withCategory("zznfqqnvwpmqta") + new OutboundEnvironmentEndpointInner().withCategory("pvswjdkirso") .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("jmkcjhwqytj") - .withEndpointDetails(Arrays.asList(new EndpointDetail())), - new EndpointDependency().withDomainName("wj") + new EndpointDependency().withDomainName("hc") + .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail())), + new EndpointDependency().withDomainName("hjtckwhd") .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail(), - new EndpointDetail(), new EndpointDetail())), - new EndpointDependency().withDomainName("rjerv") - .withEndpointDetails(Arrays.asList(new EndpointDetail())), - new EndpointDependency().withDomainName("qp") + new EndpointDetail(), new EndpointDetail())))), + new OutboundEnvironmentEndpointInner().withCategory("iy") + .withEndpoints(Arrays.asList( + new EndpointDependency().withDomainName("sqwpgrjb") + .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail(), + new EndpointDetail())), + new EndpointDependency().withDomainName("cjxvsnbyxqab") + .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail())), + new EndpointDependency().withDomainName("pcyshu") .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail(), new EndpointDetail(), new EndpointDetail())))), - new OutboundEnvironmentEndpointInner().withCategory("doy") + new OutboundEnvironmentEndpointInner().withCategory("bl") .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("thnzd") + new EndpointDependency().withDomainName("btoqcjmkljavbqid") + .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail())), + new EndpointDependency().withDomainName("zyulp") .withEndpointDetails(Arrays.asList(new EndpointDetail())), - new EndpointDependency().withDomainName("gnayqigynduh") - .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail(), - new EndpointDetail())))), - new OutboundEnvironmentEndpointInner().withCategory("lkthu") + new EndpointDependency().withDomainName("krlkhbzhfepg") + .withEndpointDetails(Arrays.asList(new EndpointDetail())))), + new OutboundEnvironmentEndpointInner().withCategory("xzlocxscp") .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("lbg") + new EndpointDependency().withDomainName("hhbcsglummajtjao") .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail(), - new EndpointDetail())), - new EndpointDependency().withDomainName("iertgccymvaolp") + new EndpointDetail(), new EndpointDetail())), + new EndpointDependency().withDomainName("nbdxk") + .withEndpointDetails(Arrays.asList(new EndpointDetail())), + new EndpointDependency().withDomainName("kajionpim") .withEndpointDetails(Arrays.asList(new EndpointDetail(), new EndpointDetail())))))); model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("zznfqqnvwpmqta", model.value().get(0).category()); - Assertions.assertEquals("jmkcjhwqytj", model.value().get(0).endpoints().get(0).domainName()); + Assertions.assertEquals("pvswjdkirso", model.value().get(0).category()); + Assertions.assertEquals("hc", model.value().get(0).endpoints().get(0).domainName()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointInnerTests.java index 588371de00aab..470a5c5b1c2bf 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointInnerTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/OutboundEnvironmentEndpointInnerTests.java @@ -15,72 +15,56 @@ public final class OutboundEnvironmentEndpointInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OutboundEnvironmentEndpointInner model = BinaryData.fromString( - "{\"category\":\"mcwyhzdxssadb\",\"endpoints\":[{\"domainName\":\"dfznudaodv\",\"endpointDetails\":[{\"ipAddress\":\"cblylpstdbhhxsr\",\"port\":1239206782,\"protocol\":\"cers\",\"description\":\"ntnev\"},{\"ipAddress\":\"wjmy\",\"port\":1774412887,\"protocol\":\"slswtm\",\"description\":\"riofzpyqse\"},{\"ipAddress\":\"abnetshh\",\"port\":199039203,\"protocol\":\"d\",\"description\":\"vwiwubmwmbesld\"},{\"ipAddress\":\"wwtppj\",\"port\":799059143,\"protocol\":\"ogaok\",\"description\":\"z\"}]},{\"domainName\":\"sikvmkqzeqqkdlt\",\"endpointDetails\":[{\"ipAddress\":\"hhvh\",\"port\":67653444,\"protocol\":\"odkwobd\",\"description\":\"xtibqdxbxwakbog\"},{\"ipAddress\":\"ndlkzgxhurip\",\"port\":2112833635,\"protocol\":\"dxunkbebxmubyyn\",\"description\":\"lrb\"},{\"ipAddress\":\"koievseo\",\"port\":143823433,\"protocol\":\"l\",\"description\":\"muwlauwzizxbm\"}]},{\"domainName\":\"cjefuzmu\",\"endpointDetails\":[{\"ipAddress\":\"tdum\",\"port\":95905507,\"protocol\":\"xe\",\"description\":\"nzbtbhj\"},{\"ipAddress\":\"lkfg\",\"port\":1036395530,\"protocol\":\"euel\",\"description\":\"hsd\"},{\"ipAddress\":\"t\",\"port\":223656030,\"protocol\":\"kd\",\"description\":\"wq\"}]}]}") + "{\"category\":\"djwzrlov\",\"endpoints\":[{\"domainName\":\"hijco\",\"endpointDetails\":[{\"ipAddress\":\"bzaqsqsycbkbfk\",\"port\":1619207085,\"protocol\":\"kexxppof\",\"description\":\"axcfjpgddtocjjx\"},{\"ipAddress\":\"pmouexhdz\",\"port\":738311617,\"protocol\":\"eojnxqbzvddn\",\"description\":\"ndei\"}]},{\"domainName\":\"twnpzaoqvuhrhcf\",\"endpointDetails\":[{\"ipAddress\":\"dglmjthjqkwp\",\"port\":920917148,\"protocol\":\"xmqci\",\"description\":\"vhkhixu\"}]},{\"domainName\":\"dtopbob\",\"endpointDetails\":[{\"ipAddress\":\"m\",\"port\":115410873,\"protocol\":\"m\",\"description\":\"hrzayvvtpgvdf\"},{\"ipAddress\":\"otkftutqxlngx\",\"port\":1542158785,\"protocol\":\"ugnxkrxdqmi\",\"description\":\"thz\"}]},{\"domainName\":\"qdrabhjybigehoqf\",\"endpointDetails\":[{\"ipAddress\":\"kanyktzlcuiywg\",\"port\":1328534140,\"protocol\":\"ndrvynhzg\",\"description\":\"hrc\"}]}]}") .toObject(OutboundEnvironmentEndpointInner.class); - Assertions.assertEquals("mcwyhzdxssadb", model.category()); - Assertions.assertEquals("dfznudaodv", model.endpoints().get(0).domainName()); - Assertions.assertEquals("cblylpstdbhhxsr", model.endpoints().get(0).endpointDetails().get(0).ipAddress()); - Assertions.assertEquals(1239206782, model.endpoints().get(0).endpointDetails().get(0).port()); - Assertions.assertEquals("cers", model.endpoints().get(0).endpointDetails().get(0).protocol()); - Assertions.assertEquals("ntnev", model.endpoints().get(0).endpointDetails().get(0).description()); + Assertions.assertEquals("djwzrlov", model.category()); + Assertions.assertEquals("hijco", model.endpoints().get(0).domainName()); + Assertions.assertEquals("bzaqsqsycbkbfk", model.endpoints().get(0).endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(1619207085, model.endpoints().get(0).endpointDetails().get(0).port()); + Assertions.assertEquals("kexxppof", model.endpoints().get(0).endpointDetails().get(0).protocol()); + Assertions.assertEquals("axcfjpgddtocjjx", model.endpoints().get(0).endpointDetails().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OutboundEnvironmentEndpointInner model = new OutboundEnvironmentEndpointInner().withCategory("mcwyhzdxssadb") + OutboundEnvironmentEndpointInner model = new OutboundEnvironmentEndpointInner().withCategory("djwzrlov") .withEndpoints(Arrays.asList( - new EndpointDependency().withDomainName("dfznudaodv") + new EndpointDependency().withDomainName("hijco") .withEndpointDetails(Arrays.asList( - new EndpointDetail().withIpAddress("cblylpstdbhhxsr") - .withPort(1239206782) - .withProtocol("cers") - .withDescription("ntnev"), - new EndpointDetail().withIpAddress("wjmy") - .withPort(1774412887) - .withProtocol("slswtm") - .withDescription("riofzpyqse"), - new EndpointDetail().withIpAddress("abnetshh") - .withPort(199039203) - .withProtocol("d") - .withDescription("vwiwubmwmbesld"), - new EndpointDetail().withIpAddress("wwtppj") - .withPort(799059143) - .withProtocol("ogaok") - .withDescription("z"))), - new EndpointDependency().withDomainName("sikvmkqzeqqkdlt") + new EndpointDetail().withIpAddress("bzaqsqsycbkbfk") + .withPort(1619207085) + .withProtocol("kexxppof") + .withDescription("axcfjpgddtocjjx"), + new EndpointDetail().withIpAddress("pmouexhdz") + .withPort(738311617) + .withProtocol("eojnxqbzvddn") + .withDescription("ndei"))), + new EndpointDependency().withDomainName("twnpzaoqvuhrhcf") + .withEndpointDetails(Arrays.asList(new EndpointDetail().withIpAddress("dglmjthjqkwp") + .withPort(920917148) + .withProtocol("xmqci") + .withDescription("vhkhixu"))), + new EndpointDependency().withDomainName("dtopbob") .withEndpointDetails(Arrays.asList( - new EndpointDetail().withIpAddress("hhvh") - .withPort(67653444) - .withProtocol("odkwobd") - .withDescription("xtibqdxbxwakbog"), - new EndpointDetail().withIpAddress("ndlkzgxhurip") - .withPort(2112833635) - .withProtocol("dxunkbebxmubyyn") - .withDescription("lrb"), - new EndpointDetail().withIpAddress("koievseo") - .withPort(143823433) - .withProtocol("l") - .withDescription("muwlauwzizxbm"))), - new EndpointDependency().withDomainName("cjefuzmu") - .withEndpointDetails(Arrays.asList( - new EndpointDetail().withIpAddress("tdum") - .withPort(95905507) - .withProtocol("xe") - .withDescription("nzbtbhj"), - new EndpointDetail().withIpAddress("lkfg") - .withPort(1036395530) - .withProtocol("euel") - .withDescription("hsd"), - new EndpointDetail().withIpAddress("t") - .withPort(223656030) - .withProtocol("kd") - .withDescription("wq"))))); + new EndpointDetail().withIpAddress("m") + .withPort(115410873) + .withProtocol("m") + .withDescription("hrzayvvtpgvdf"), + new EndpointDetail().withIpAddress("otkftutqxlngx") + .withPort(1542158785) + .withProtocol("ugnxkrxdqmi") + .withDescription("thz"))), + new EndpointDependency().withDomainName("qdrabhjybigehoqf") + .withEndpointDetails(Arrays.asList(new EndpointDetail().withIpAddress("kanyktzlcuiywg") + .withPort(1328534140) + .withProtocol("ndrvynhzg") + .withDescription("hrc"))))); model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointInner.class); - Assertions.assertEquals("mcwyhzdxssadb", model.category()); - Assertions.assertEquals("dfznudaodv", model.endpoints().get(0).domainName()); - Assertions.assertEquals("cblylpstdbhhxsr", model.endpoints().get(0).endpointDetails().get(0).ipAddress()); - Assertions.assertEquals(1239206782, model.endpoints().get(0).endpointDetails().get(0).port()); - Assertions.assertEquals("cers", model.endpoints().get(0).endpointDetails().get(0).protocol()); - Assertions.assertEquals("ntnev", model.endpoints().get(0).endpointDetails().get(0).description()); + Assertions.assertEquals("djwzrlov", model.category()); + Assertions.assertEquals("hijco", model.endpoints().get(0).domainName()); + Assertions.assertEquals("bzaqsqsycbkbfk", model.endpoints().get(0).endpointDetails().get(0).ipAddress()); + Assertions.assertEquals(1619207085, model.endpoints().get(0).endpointDetails().get(0).port()); + Assertions.assertEquals("kexxppof", model.endpoints().get(0).endpointDetails().get(0).protocol()); + Assertions.assertEquals("axcfjpgddtocjjx", model.endpoints().get(0).endpointDetails().get(0).description()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 12c6860973aa7..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"zrnf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ispe\",\"actionsRequired\":\"tzfkufubl\"},\"provisioningState\":\"InternalError\",\"groupIds\":[\"eofjaeqjh\"]},\"etag\":\"b\",\"id\":\"v\",\"name\":\"smjqulngsntnbyb\",\"type\":\"zgcwrw\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ispe", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tzfkufubl", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("b", model.etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("ispe") - .withActionsRequired("tzfkufubl"))) - .withEtag("b"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ispe", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tzfkufubl", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("b", model.etag()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 923418bef5ff8..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"gx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xnehmpvec\",\"actionsRequired\":\"odebfqkkrbmpu\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"flz\",\"fbxzpuzycisp\",\"qzahmgkbrp\",\"y\"]},\"etag\":\"ibnuqqkpik\",\"id\":\"rgvtqag\",\"name\":\"buynhijggm\",\"type\":\"bfs\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"utrc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"zzmhjrunmpxttd\",\"actionsRequired\":\"rbnlankxmyskp\"},\"provisioningState\":\"Canceled\",\"groupIds\":[\"tkcxywnytnrsy\",\"lqidyby\",\"czfc\",\"haaxdbabphl\"]},\"etag\":\"qlfktsths\",\"id\":\"ocmnyyazttbtwwrq\",\"name\":\"uedck\",\"type\":\"ywbiexzfeyueax\"}],\"nextLink\":\"xujwbhqwalmuzyo\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xnehmpvec", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("odebfqkkrbmpu", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).etag()); - Assertions.assertEquals("xujwbhqwalmuzyo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model - = new PrivateEndpointConnectionListResult() - .withValue( - Arrays.asList( - new PrivateEndpointConnectionInner().withProperties( - new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("xnehmpvec") - .withActionsRequired("odebfqkkrbmpu"))) - .withEtag("ibnuqqkpik"), - new PrivateEndpointConnectionInner() - .withProperties( - new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("zzmhjrunmpxttd") - .withActionsRequired("rbnlankxmyskp"))) - .withEtag("qlfktsths"))) - .withNextLink("xujwbhqwalmuzyo"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xnehmpvec", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("odebfqkkrbmpu", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).etag()); - Assertions.assertEquals("xujwbhqwalmuzyo", model.nextLink()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index bd783c4929813..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"xwrljdouskcqvkoc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"kwt\",\"actionsRequired\":\"xbnjbiksq\"},\"provisioningState\":\"Canceled\",\"groupIds\":[\"ainqpjwnzlljfm\",\"pee\",\"vmgxsab\"]}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kwt", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xbnjbiksq", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("kwt") - .withActionsRequired("xbnjbiksq")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kwt", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xbnjbiksq", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterMockTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterMockTests.java deleted file mode 100644 index 5038c2dc96f07..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointConnectionsListByCloudHsmClusterMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hardwaresecuritymodules.HardwareSecurityModulesManager; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByCloudHsmClusterMockTests { - @Test - public void testListByCloudHsmCluster() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"fktgplc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xeznoi\",\"actionsRequired\":\"rnjwmw\"},\"provisioningState\":\"Updating\",\"groupIds\":[\"azej\"]},\"etag\":\"qkagfhsxt\",\"id\":\"ugzxnf\",\"name\":\"azpxdtnkdmkqjjl\",\"type\":\"uenvrkp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HardwareSecurityModulesManager manager = HardwareSecurityModulesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateEndpointConnections() - .listByCloudHsmCluster("wslolbqp", "uzlm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xeznoi", - response.iterator().next().properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rnjwmw", - response.iterator().next().properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("qkagfhsxt", response.iterator().next().etag()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointTests.java deleted file mode 100644 index 3a6358f525427..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"qduujitcjczdz\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceInnerTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index a29851c5fbf41..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceInnerTests.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.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"xuconu\",\"requiredMembers\":[\"fkbey\"],\"requiredZoneNames\":[\"rmjmwvvjektc\",\"senhwlrs\",\"frzpwvlqdqgb\",\"qylihkaetckt\"]},\"id\":\"civfsnkymuctq\",\"name\":\"jf\",\"type\":\"ebrjcxe\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("rmjmwvvjektc", model.properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model - = new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("rmjmwvvjektc", "senhwlrs", "frzpwvlqdqgb", "qylihkaetckt"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("rmjmwvvjektc", model.properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceListResultTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index 8a879f2c661da..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceListResult; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"myokacspkwlh\",\"requiredMembers\":[\"bpxjmfl\",\"vvnchrkcc\",\"wwzjuqkhrsajiwku\"],\"requiredZoneNames\":[\"skghsauuimj\"]},\"id\":\"xieduugidyjrr\",\"name\":\"byao\",\"type\":\"v\"},{\"properties\":{\"groupId\":\"sonpclhocohs\",\"requiredMembers\":[\"vleggzfbuhfmvfax\"],\"requiredZoneNames\":[\"eiithlvmez\",\"v\",\"hxmzsbbzoggig\"]},\"id\":\"wburvjxxjnspydpt\",\"name\":\"oenkouknvudwti\",\"type\":\"kbldngkpocipa\"},{\"properties\":{\"groupId\":\"o\",\"requiredMembers\":[\"kgjn\",\"iucgygevqzn\",\"yp\",\"rbpizc\"],\"requiredZoneNames\":[\"j\",\"dpydn\",\"yhxdeoejzicwi\",\"sjttgzfbish\"]},\"id\":\"khaj\",\"name\":\"eyeam\",\"type\":\"p\"},{\"properties\":{\"groupId\":\"alpbuxwgipwhon\",\"requiredMembers\":[\"gshwankixz\",\"injep\"],\"requiredZoneNames\":[\"mryw\",\"uzoqft\"]},\"id\":\"qzrnkcqvyxlwhz\",\"name\":\"sicohoqqnwvlry\",\"type\":\"vwhheunmmqhgyx\"}],\"nextLink\":\"onocukok\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("skghsauuimj", model.value().get(0).properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult().withValue(Arrays.asList( - new PrivateLinkResourceInner().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("skghsauuimj"))), - new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("eiithlvmez", "v", "hxmzsbbzoggig"))), - new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("j", "dpydn", "yhxdeoejzicwi", "sjttgzfbish"))), - new PrivateLinkResourceInner().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("mryw", "uzoqft"))))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("skghsauuimj", model.value().get(0).properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourcePropertiesTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 19d90ceb6014b..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkResourcePropertiesTests.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.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"uwutttxfvjrbi\",\"requiredMembers\":[\"xepcyvahfn\",\"jky\",\"xjvuujqgidokg\",\"ljyoxgvcltb\"],\"requiredZoneNames\":[\"c\",\"hkjeszzhbi\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("c", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model - = new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("c", "hkjeszzhbi")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("c", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 79e6f662b9028..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.hardwaresecuritymodules.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model - = BinaryData.fromString("{\"status\":\"Pending\",\"description\":\"hkr\",\"actionsRequired\":\"d\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("hkr", model.description()); - Assertions.assertEquals("d", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("hkr") - .withActionsRequired("d"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("hkr", model.description()); - Assertions.assertEquals("d", model.actionsRequired()); - } -} diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/SkuTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/SkuTests.java index 721032cfe56ec..08d32cfb247d9 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/SkuTests.java +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/SkuTests.java @@ -12,14 +12,14 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"payShield10K_LMK1_CPS60\"}").toObject(Sku.class); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS60, model.name()); + Sku model = BinaryData.fromString("{\"name\":\"payShield10K_LMK1_CPS250\"}").toObject(Sku.class); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS250, model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS60); + Sku model = new Sku().withName(SkuName.PAY_SHIELD10K_LMK1_CPS250); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS60, model.name()); + Assertions.assertEquals(SkuName.PAY_SHIELD10K_LMK1_CPS250, model.name()); } } diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/UserAssignedIdentityTests.java b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 39627dcafca13..0000000000000 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/src/test/java/com/azure/resourcemanager/hardwaresecuritymodules/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hardwaresecuritymodules.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hardwaresecuritymodules.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"f99f391a-c330-434d-88f7-c8ceb480b348\",\"clientId\":\"9ba528df-3687-4f7f-a4cd-fdc4f1599359\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}