From ee33352f731220273098e06cab0c7e05fc6c4a6b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Apr 2022 07:47:01 +0000 Subject: [PATCH] CodeGen from PR 18306 in Azure/azure-rest-api-specs Merge c7a848c7143843c96ed2ab19f611824314f12104 into 49f003bd7b06f60a7be792d6b38a20678c7610cc --- .../CHANGELOG.md | 3 +- .../README.md | 23 +- .../SAMPLE.md | 769 ++++++++++++++++++ .../pom.xml | 93 ++- .../RecoveryServicesManager.java | 84 +- .../fluent/OperationsClient.java | 6 +- .../PrivateLinkResourcesOperationsClient.java | 8 +- .../fluent/RecoveryServicesClient.java | 2 +- .../RecoveryServicesManagementClient.java | 7 + .../fluent/RegisteredIdentitiesClient.java | 2 +- .../fluent/ReplicationUsagesClient.java | 4 +- .../fluent/ResourceProvidersClient.java | 75 ++ .../recoveryservices/fluent/UsagesClient.java | 4 +- .../fluent/VaultCertificatesClient.java | 3 +- .../fluent/VaultExtendedInfoesClient.java | 6 +- .../recoveryservices/fluent/VaultsClient.java | 82 +- .../CheckNameAvailabilityResultInner.java | 4 - ...ClientDiscoveryValueForSingleApiInner.java | 4 - .../fluent/models/OperationResourceInner.java | 185 +++++ .../models/PrivateLinkResourceInner.java | 49 +- .../models/PrivateLinkResourceProperties.java | 68 ++ .../fluent/models/ReplicationUsageInner.java | 4 - .../models/VaultCertificateResponseInner.java | 4 - .../fluent/models/VaultExtendedInfo.java | 124 +++ .../VaultExtendedInfoResourceInner.java | 106 +-- .../fluent/models/VaultInner.java | 20 +- .../fluent/models/VaultUsageInner.java | 4 - .../CheckNameAvailabilityResultImpl.java | 8 +- .../ClientDiscoveryValueForSingleApiImpl.java | 8 +- .../implementation/OperationResourceImpl.java | 55 ++ .../implementation/OperationsClientImpl.java | 31 +- .../implementation/OperationsImpl.java | 16 +- .../PrivateLinkResourceImpl.java | 9 +- ...vateLinkResourcesOperationsClientImpl.java | 41 +- .../PrivateLinkResourcesOperationsImpl.java | 15 +- .../RecoveryServicesClientImpl.java | 15 +- .../implementation/RecoveryServicesImpl.java | 12 +- .../RecoveryServicesManagementClientImpl.java | 26 +- .../RegisteredIdentitiesClientImpl.java | 13 +- .../RegisteredIdentitiesImpl.java | 12 +- .../implementation/ReplicationUsageImpl.java | 9 +- .../ReplicationUsagesClientImpl.java | 17 +- .../implementation/ReplicationUsagesImpl.java | 16 +- .../ResourceProvidersClientImpl.java | 412 ++++++++++ .../implementation/ResourceProvidersImpl.java | 88 ++ .../implementation/UsagesClientImpl.java | 17 +- .../implementation/UsagesImpl.java | 15 +- .../implementation/Utils.java | 137 ++++ .../VaultCertificateResponseImpl.java | 12 +- .../VaultCertificatesClientImpl.java | 17 +- .../implementation/VaultCertificatesImpl.java | 12 +- .../VaultExtendedInfoResourceImpl.java | 17 +- .../VaultExtendedInfoesClientImpl.java | 33 +- .../VaultExtendedInfoesImpl.java | 12 +- .../implementation/VaultImpl.java | 33 +- .../implementation/VaultUsageImpl.java | 9 +- .../implementation/VaultsClientImpl.java | 350 ++++++-- .../implementation/VaultsImpl.java | 37 +- .../models/BackupStorageVersion.java | 37 + .../models/CertificateRequest.java | 4 - .../CheckNameAvailabilityParameters.java | 4 - .../models/ClientDiscoveryDisplay.java | 4 - .../ClientDiscoveryForLogSpecification.java | 4 - .../models/ClientDiscoveryForProperties.java | 4 - ...lientDiscoveryForServiceSpecification.java | 4 - .../models/ClientDiscoveryResponse.java | 4 - .../models/CmkKekIdentity.java | 78 ++ .../models/CmkKeyVaultProperties.java | 46 ++ .../recoveryservices/models/IdentityData.java | 63 +- .../models/InfrastructureEncryptionState.java | 34 + .../recoveryservices/models/JobsSummary.java | 4 - .../models/MonitoringSummary.java | 4 - .../recoveryservices/models/NameInfo.java | 4 - .../models/OperationResource.java | 63 ++ .../recoveryservices/models/Operations.java | 6 +- .../models/PatchTrackedResource.java | 8 +- .../recoveryservices/models/PatchVault.java | 4 - .../models/PrivateEndpoint.java | 4 - .../models/PrivateEndpointConnection.java | 4 - ...vateEndpointConnectionVaultProperties.java | 51 +- .../models/PrivateLinkResources.java | 4 - .../PrivateLinkResourcesOperations.java | 8 +- .../PrivateLinkServiceConnectionState.java | 4 - .../models/RawCertificateData.java | 4 - .../models/RecoveryServices.java | 2 +- .../models/RegisteredIdentities.java | 2 +- .../models/ReplicationUsageList.java | 4 - .../models/ReplicationUsages.java | 4 +- .../ResourceCertificateAndAadDetails.java | 41 +- .../ResourceCertificateAndAcsDetails.java | 11 +- .../models/ResourceCertificateDetails.java | 4 - .../models/ResourceIdentityType.java | 6 + .../models/ResourceMoveState.java | 58 ++ .../models/ResourceProviders.java | 67 ++ .../recoveryservices/models/Sku.java | 111 ++- .../models/UpgradeDetails.java | 4 - .../recoveryservices/models/Usages.java | 4 +- .../recoveryservices/models/UserIdentity.java | 50 ++ .../recoveryservices/models/Vault.java | 8 + .../models/VaultExtendedInfoResource.java | 14 +- .../models/VaultExtendedInfoes.java | 6 +- .../recoveryservices/models/VaultList.java | 4 - .../models/VaultProperties.java | 92 ++- .../models/VaultPropertiesEncryption.java | 105 +++ .../models/VaultPropertiesMoveDetails.java | 96 +++ .../models/VaultUsageList.java | 4 - .../recoveryservices/models/Vaults.java | 18 +- .../generated/OperationsListSamples.java | 22 + ...ivateLinkResourcesOperationGetSamples.java | 25 + ...vateLinkResourcesOperationListSamples.java | 23 + ...yServicesCheckNameAvailabilitySamples.java | 55 ++ .../RegisteredIdentitiesDeleteSamples.java | 23 + .../ReplicationUsagesListSamples.java | 23 + ...urceProviderGetOperationResultSamples.java | 28 + ...urceProviderGetOperationStatusSamples.java | 28 + .../generated/UsagesListByVaultsSamples.java | 22 + .../VaultCertificatesCreateSamples.java | 34 + ...aultExtendedInfoCreateOrUpdateSamples.java | 25 + .../VaultExtendedInfoGetSamples.java | 25 + .../VaultExtendedInfoUpdateSamples.java | 25 + .../VaultsCreateOrUpdateSamples.java | 119 +++ .../generated/VaultsDeleteSamples.java | 23 + .../VaultsGetByResourceGroupSamples.java | 25 + .../VaultsListByResourceGroupSamples.java | 23 + .../generated/VaultsListSamples.java | 23 + .../generated/VaultsUpdateSamples.java | 166 ++++ 126 files changed, 4515 insertions(+), 642 deletions(-) create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ResourceProvidersClient.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/OperationResourceInner.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfo.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationResourceImpl.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersImpl.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BackupStorageVersion.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKekIdentity.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKeyVaultProperties.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/InfrastructureEncryptionState.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/OperationResource.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceMoveState.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceProviders.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UserIdentity.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesEncryption.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesMoveDetails.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationGetSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationListSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilitySamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationResultSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationStatusSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoCreateOrUpdateSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoGetSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoUpdateSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsCreateOrUpdateSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsDeleteSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsGetByResourceGroupSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListByResourceGroupSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListSamples.java create mode 100644 sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsUpdateSamples.java diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md index f6230465e9620..e9dcb3a93ec0d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-04-05) +- Azure Resource Manager RecoveryServices client library for Java. This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2020-12-18) diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md index 1520bad97953e..0b489b8c283a0 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md @@ -2,7 +2,21 @@ Azure Resource Manager RecoveryServices client library for Java. -This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2016-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 RecoveryServices Management SDK. Recovery Services Client. Package tag package-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] ## Getting started @@ -18,7 +32,7 @@ This package contains Microsoft Azure SDK for RecoveryServices Management SDK. R com.azure.resourcemanager azure-resourcemanager-recoveryservices - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -60,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md) + + ## Troubleshooting ## Next steps @@ -75,6 +92,8 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Create new Pull Request +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md new file mode 100644 index 0000000000000..a7341803da6c3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md @@ -0,0 +1,769 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## PrivateLinkResourcesOperation + +- [Get](#privatelinkresourcesoperation_get) +- [List](#privatelinkresourcesoperation_list) + +## RecoveryServices + +- [CheckNameAvailability](#recoveryservices_checknameavailability) + +## RegisteredIdentities + +- [Delete](#registeredidentities_delete) + +## ReplicationUsages + +- [List](#replicationusages_list) + +## ResourceProvider + +- [GetOperationResult](#resourceprovider_getoperationresult) +- [GetOperationStatus](#resourceprovider_getoperationstatus) + +## Usages + +- [ListByVaults](#usages_listbyvaults) + +## VaultCertificates + +- [Create](#vaultcertificates_create) + +## VaultExtendedInfo + +- [CreateOrUpdate](#vaultextendedinfo_createorupdate) +- [Get](#vaultextendedinfo_get) +- [Update](#vaultextendedinfo_update) + +## Vaults + +- [CreateOrUpdate](#vaults_createorupdate) +- [Delete](#vaults_delete) +- [GetByResourceGroup](#vaults_getbyresourcegroup) +- [List](#vaults_list) +- [ListByResourceGroup](#vaults_listbyresourcegroup) +- [Update](#vaults_update) +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOperations(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateLinkResourcesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation Get. */ +public final class PrivateLinkResourcesOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetPrivateLinkResources.json + */ + /** + * Sample code: Get PrivateLinkResource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getPrivateLinkResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .privateLinkResourcesOperations() + .getWithResponse("petesting", "pemsi-ecy-rsv2", "backupResource", Context.NONE); + } +} +``` + +### PrivateLinkResourcesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation List. */ +public final class PrivateLinkResourcesOperationListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListPrivateLinkResources.json + */ + /** + * Sample code: List PrivateLinkResources. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listPrivateLinkResources( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.privateLinkResourcesOperations().list("petesting", "pemsi-ecy-rsv2", Context.NONE); + } +} +``` + +### RecoveryServices_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; + +/** Samples for RecoveryServices CheckNameAvailability. */ +public final class RecoveryServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/CheckNameAvailability_Available.json + */ + /** + * Sample code: Availability status of Resource Name when no resource with same name, type and subscription exists, + * nor has been deleted within last 24 hours. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void + availabilityStatusOfResourceNameWhenNoResourceWithSameNameTypeAndSubscriptionExistsNorHasBeenDeletedWithinLast24Hours( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .recoveryServices() + .checkNameAvailabilityWithResponse( + "resGroupFoo", + "westus", + new CheckNameAvailabilityParameters() + .withType("Microsoft.RecoveryServices/Vaults") + .withName("swaggerExample"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/CheckNameAvailability_NotAvailable.json + */ + /** + * Sample code: Availability status of Resource Name when resource with same name, type and subscription exists. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void availabilityStatusOfResourceNameWhenResourceWithSameNameTypeAndSubscriptionExists( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .recoveryServices() + .checkNameAvailabilityWithResponse( + "resGroupBar", + "westus", + new CheckNameAvailabilityParameters() + .withType("Microsoft.RecoveryServices/Vaults") + .withName("swaggerExample2"), + Context.NONE); + } +} +``` + +### RegisteredIdentities_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredIdentities Delete. */ +public final class RegisteredIdentitiesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/DeleteRegisteredIdentities.json + */ + /** + * Sample code: Delete registered Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void deleteRegisteredIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.registeredIdentities().deleteWithResponse("BCDRIbzRG", "BCDRIbzVault", "dpmcontainer01", Context.NONE); + } +} +``` + +### ReplicationUsages_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationUsages List. */ +public final class ReplicationUsagesListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListReplicationUsages.json + */ + /** + * Sample code: Gets Replication usages of vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getsReplicationUsagesOfVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.replicationUsages().list("avrai7517RG1", "avrai7517Vault1", Context.NONE); + } +} +``` + +### ResourceProvider_GetOperationResult + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationResult. */ +public final class ResourceProviderGetOperationResultSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetOperationResult.json + */ + /** + * Sample code: Get Operation Result. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getOperationResult(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .resourceProviders() + .getOperationResultWithResponse( + "HelloWorld", + "swaggerExample", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); + } +} +``` + +### ResourceProvider_GetOperationStatus + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationStatus. */ +public final class ResourceProviderGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetOperationStatus.json + */ + /** + * Sample code: Get Operation Status. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .resourceProviders() + .getOperationStatusWithResponse( + "HelloWorld", + "swaggerExample", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); + } +} +``` + +### Usages_ListByVaults + +```java +import com.azure.core.util.Context; + +/** Samples for Usages ListByVaults. */ +public final class UsagesListByVaultsSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListUsages.json + */ + /** + * Sample code: Gets vault usages. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getsVaultUsages(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.usages().listByVaults("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### VaultCertificates_Create + +```java +import com.azure.resourcemanager.recoveryservices.models.AuthType; +import com.azure.resourcemanager.recoveryservices.models.RawCertificateData; + +/** Samples for VaultCertificates Create. */ +public final class VaultCertificatesCreateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVaultCred.json + */ + /** + * Sample code: Download vault credential file. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void downloadVaultCredentialFile( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultCertificates() + .define("BCDRIbzVault77777777-d41f-4550-9f70-7708a3a2283b-12-18-2017-vaultcredentials") + .withExistingVault("BCDRIbzRG", "BCDRIbzVault") + .withProperties( + new RawCertificateData() + .withAuthType(AuthType.AAD) + .withCertificate( + "MTTC3TCCAcWgAwIBAgIQEj9h+ZLlXK9KrqZX9UkAnzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE3MTIxODA5MTc1M1oXDTE3MTIyMzA5Mjc1M1owHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK773/eZZ69RbZZAT05r9MjUxu9y1L1Pn1EgPk62IPJyHlO3OZA922eSBahhP4bgmFljN4LVReqQ5eT/wqO0Zhc+yFkUy4U4RdbQLeUZt2W7yy9XLXgVvqeYDgsjg/QhHetgHArQBW+tlQq5+zPdU7zchI4rbShSJrWhLrZFWiOyFPsuAE4joUQHNlRifdCTsBGKk8HRCY3j1S3c4bfEn3zxlrvrXXssRuW5mJM95rMk0tskoRxXSCi6i9bnlki2Cs9mpVMmBFeofs41KwzlWU0TgpdD8s1QEdvfGB5NbByfetPX7MfJaTBeHZEGbv/Iq8l72u8sPBoOhcaH7qDE/mECAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAILfgHluye1Q+WelhgWhpBBdIq2C0btfV8eFsZaTlBUrM0fwpxQSlAWc2oYHVMQI4A5iUjbDOY35O4yc+TnWKDBKf+laqDP+yos4aiUPuadGUZfvDk7kuw7xeECs64JpHAIEKdRHFW9rD3gwG+nIWaDnEL/7rTyhL3kXrRW2MSUAL8g3GX8Z45c+MQY0jmASIqWdhGn1vpAGyA9mKkzsqg7FXjg8GZb24tGl5Ky85+ip4dkBfXinDD8WwaGyjhGGK97ErvNmN36qly/H0H1Qngiovg1FbHDmkcFO5QclnEJsFFmcO2CcHp5Fqh2wXn5O1cQaxCIRTpQ/uXRpDjl2wKs=" + .getBytes())) + .create(); + } +} +``` + +### VaultExtendedInfo_CreateOrUpdate + +```java +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo CreateOrUpdate. */ +public final class VaultExtendedInfoCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/UpdateVaultExtendedInfo.json + */ + /** + * Sample code: Put ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void putExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .createOrUpdateWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", null, Context.NONE); + } +} +``` + +### VaultExtendedInfo_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo Get. */ +public final class VaultExtendedInfoGetSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GETVaultExtendedInfo.json + */ + /** + * Sample code: Get ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .getWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### VaultExtendedInfo_Update + +```java +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo Update. */ +public final class VaultExtendedInfoUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/UpdateVaultExtendedInfo.json + */ + /** + * Sample code: PATCH ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void pATCHExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .updateWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", null, Context.NONE); + } +} +``` + +### Vaults_CreateOrUpdate + +```java +import com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity; +import com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties; +import com.azure.resourcemanager.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState; +import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType; +import com.azure.resourcemanager.recoveryservices.models.Sku; +import com.azure.resourcemanager.recoveryservices.models.SkuName; +import com.azure.resourcemanager.recoveryservices.models.UserIdentity; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vaults CreateOrUpdate. */ +public final class VaultsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault_WithCMK.json + */ + /** + * Sample code: Create or Update Vault with CustomerManagedKeys. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateVaultWithCustomerManagedKeys( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")) + .withKekIdentity( + new CmkKekIdentity() + .withUserAssignedIdentity( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")) + .withInfrastructureEncryption(InfrastructureEncryptionState.ENABLED))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault.json + */ + /** + * Sample code: Create or Update Recovery Services vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateRecoveryServicesVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new VaultProperties()) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault_WithUserAssignedIdentity.json + */ + /** + * Sample code: Create or Update Vault with User Assigned Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateVaultWithUserAssignedIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .withProperties(new VaultProperties()) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + @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; + } +} +``` + +### Vaults_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults Delete. */ +public final class VaultsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/DeleteVault.json + */ + /** + * Sample code: Delete Recovery Services Vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void deleteRecoveryServicesVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().deleteWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### Vaults_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults GetByResourceGroup. */ +public final class VaultsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GETVault.json + */ + /** + * Sample code: Get Recovery Services Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getRecoveryServicesResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .getByResourceGroupWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} +``` + +### Vaults_List + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults List. */ +public final class VaultsListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListBySubscriptionIds.json + */ + /** + * Sample code: List of Recovery Services Resources in SubscriptionId. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOfRecoveryServicesResourcesInSubscriptionId( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().list(Context.NONE); + } +} +``` + +### Vaults_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults ListByResourceGroup. */ +public final class VaultsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListResources.json + */ + /** + * Sample code: List of Recovery Services Resources in ResourceGroup. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOfRecoveryServicesResourcesInResourceGroup( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().listByResourceGroup("Default-RecoveryServices-ResourceGroup", Context.NONE); + } +} +``` + +### Vaults_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity; +import com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties; +import com.azure.resourcemanager.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState; +import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType; +import com.azure.resourcemanager.recoveryservices.models.UserIdentity; +import com.azure.resourcemanager.recoveryservices.models.Vault; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vaults Update. */ +public final class VaultsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithCMK.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")) + .withKekIdentity( + new CmkKekIdentity() + .withUserAssignedIdentity( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")) + .withInfrastructureEncryption(InfrastructureEncryptionState.ENABLED))) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PatchVault_WithCMK2.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys2. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys2( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKekIdentity(new CmkKekIdentity().withUseSystemAssignedIdentity(true)))) + .withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithCMK3.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys3. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys3( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")))) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault.json + */ + /** + * Sample code: Update Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResource(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource.update().withTags(mapOf("PatchKey", "PatchKeyUpdated")).apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithUserAssignedIdentity.json + */ + /** + * Sample code: Update Resource With User Assigned Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithUserAssignedIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml index f3d2e237c6e69..22e93394eeaac 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml @@ -1,50 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-recoveryservices - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-recoveryservices + 1.0.0-beta.2 + jar - Microsoft Azure SDK for RecoveryServices Management - This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2016-06. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for RecoveryServices Management + This package contains Microsoft Azure SDK for RecoveryServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Recovery Services Client. Package tag package-2022-02. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core-management - 1.5.4 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java index 80e1cac928634..e7c6200c35cbd 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -27,6 +28,7 @@ import com.azure.resourcemanager.recoveryservices.implementation.RecoveryServicesManagementClientBuilder; import com.azure.resourcemanager.recoveryservices.implementation.RegisteredIdentitiesImpl; import com.azure.resourcemanager.recoveryservices.implementation.ReplicationUsagesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.recoveryservices.implementation.UsagesImpl; import com.azure.resourcemanager.recoveryservices.implementation.VaultCertificatesImpl; import com.azure.resourcemanager.recoveryservices.implementation.VaultExtendedInfoesImpl; @@ -36,6 +38,7 @@ import com.azure.resourcemanager.recoveryservices.models.RecoveryServices; import com.azure.resourcemanager.recoveryservices.models.RegisteredIdentities; import com.azure.resourcemanager.recoveryservices.models.ReplicationUsages; +import com.azure.resourcemanager.recoveryservices.models.ResourceProviders; import com.azure.resourcemanager.recoveryservices.models.Usages; import com.azure.resourcemanager.recoveryservices.models.VaultCertificates; import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; @@ -45,6 +48,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to RecoveryServicesManager. Recovery Services Client. */ public final class RecoveryServicesManager { @@ -64,6 +68,8 @@ public final class RecoveryServicesManager { private VaultExtendedInfoes vaultExtendedInfoes; + private ResourceProviders resourceProviders; + private Usages usages; private final RecoveryServicesManagementClient clientObject; @@ -104,11 +110,12 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -148,6 +155,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -166,9 +184,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -184,25 +204,53 @@ public RecoveryServicesManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.recoveryservices") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); - policies - .add( - new UserAgentPolicy( - null, - "com.azure.resourcemanager.recoveryservices", - "1.0.0-beta.1", - Configuration.getGlobalConfiguration())); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -279,6 +327,14 @@ public VaultExtendedInfoes vaultExtendedInfoes() { return vaultExtendedInfoes; } + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + /** @return Resource collection API of Usages. */ public Usages usages() { if (this.usages == null) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java index 4bc1a2ee13850..3cae8217116af 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java @@ -17,7 +17,8 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +30,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java index aff819a4682f5..123eb4b2d9bad 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java @@ -21,7 +21,8 @@ public interface PrivateLinkResourcesOperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName); @@ -35,7 +36,8 @@ public interface PrivateLinkResourcesOperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName, Context context); @@ -64,7 +66,7 @@ public interface PrivateLinkResourcesOperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java index 5ac1944198278..c24ef8c9f5021 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java @@ -42,7 +42,7 @@ CheckNameAvailabilityResultInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java index e3e15634178d4..40080bea285f1 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java @@ -100,6 +100,13 @@ public interface RecoveryServicesManagementClient { */ VaultExtendedInfoesClient getVaultExtendedInfoes(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + /** * Gets the UsagesClient object to access its operations. * diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java index ee406e13f77bd..07792a5683d39 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java @@ -34,7 +34,7 @@ public interface RegisteredIdentitiesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String vaultName, String identityName, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java index aad20335ba814..ff9912811c52c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java @@ -20,7 +20,7 @@ public interface ReplicationUsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName); @@ -34,7 +34,7 @@ public interface ReplicationUsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String vaultName, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ResourceProvidersClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..24838c9d99e51 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ResourceProvidersClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner getOperationStatus(String resourceGroupName, String vaultName, String operationId); + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOperationStatusWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner getOperationResult(String resourceGroupName, String vaultName, String operationId); + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOperationResultWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java index ffc34e7d1d6e8..bee86b4348d70 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java @@ -20,7 +20,7 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByVaults(String resourceGroupName, String vaultName); @@ -34,7 +34,7 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java index 3c55c10b94702..f236d6f1a3c29 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java @@ -40,7 +40,8 @@ VaultCertificateResponseInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java index afb8d2f101285..7b4eb68cc647d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java @@ -34,7 +34,7 @@ public interface VaultExtendedInfoesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -65,7 +65,7 @@ VaultExtendedInfoResourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -99,7 +99,7 @@ VaultExtendedInfoResourceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java index 23dda15b6a603..abd7025996bcb 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java @@ -8,7 +8,9 @@ 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.recoveryservices.fluent.models.VaultInner; import com.azure.resourcemanager.recoveryservices.models.PatchVault; @@ -19,7 +21,7 @@ public interface VaultsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -31,7 +33,7 @@ public interface VaultsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -43,7 +45,7 @@ public interface VaultsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -56,7 +58,7 @@ public interface VaultsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -83,11 +85,42 @@ public interface VaultsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultInner vault); + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultInner vault, Context context); + /** * Creates or updates a Recovery Services vault. * @@ -115,8 +148,7 @@ public interface VaultsClient { * @return resource information, as returned by the resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String vaultName, VaultInner vault, Context context); + VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultInner vault, Context context); /** * Deletes a vault. @@ -139,11 +171,42 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> beginUpdate( + String resourceGroupName, String vaultName, PatchVault vault); + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> beginUpdate( + String resourceGroupName, String vaultName, PatchVault vault, Context context); + /** * Updates the vault. * @@ -171,6 +234,5 @@ Response createOrUpdateWithResponse( * @return resource information, as returned by the resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String vaultName, PatchVault vault, Context context); + VaultInner update(String resourceGroupName, String vaultName, PatchVault vault, Context context); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java index 558d40daf9805..25e75d1f01433 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Response for check name availability API. Resource provider will set availability as true | false. */ @Fluent public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - /* * The nameAvailable property. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java index d72d790ef3bc2..f18ea30ea0526 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Available operation details. */ @Fluent public final class ClientDiscoveryValueForSingleApiInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryValueForSingleApiInner.class); - /* * Name of the Operation. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/OperationResourceInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/OperationResourceInner.java new file mode 100644 index 0000000000000..2a0da865e9c99 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/OperationResourceInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation Resource. */ +@Fluent +public final class OperationResourceInner { + /* + * End time of the operation + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Required if status == failed or status == canceled. This is the OData v4 + * error format, used by the RPC and will go into the v2.2 Azure REST API + * guidelines. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /* + * It should match what is used to GET the operation result + */ + @JsonProperty(value = "id") + private String id; + + /* + * It must match the last segment of the "id" field, and will typically be + * a GUID / system generated value + */ + @JsonProperty(value = "name") + private String name; + + /* + * The status of the operation. (InProgress/Success/Failed/Cancelled) + */ + @JsonProperty(value = "status") + private String status; + + /* + * Start time of the operation + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** + * Get the endTime property: End time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the error property: Required if status == failed or status == canceled. This is the OData v4 error format, + * used by the RPC and will go into the v2.2 Azure REST API guidelines. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: Required if status == failed or status == canceled. This is the OData v4 error format, + * used by the RPC and will go into the v2.2 Azure REST API guidelines. + * + * @param error the error value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the id property: It should match what is used to GET the operation result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: It should match what is used to GET the operation result. + * + * @param id the id value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: It must match the last segment of the "id" field, and will typically be a GUID / system + * generated value. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: It must match the last segment of the "id" field, and will typically be a GUID / system + * generated value. + * + * @param name the name value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: The status of the operation. (InProgress/Success/Failed/Cancelled). + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the operation. (InProgress/Success/Failed/Cancelled). + * + * @param status the status value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java index 2b62e074729b1..947782f48cb54 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java @@ -4,18 +4,18 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Information of the private link resource. */ -@JsonFlatten -@Immutable -public class PrivateLinkResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); +@Fluent +public final class PrivateLinkResourceInner { + /* + * Resource properties + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; /* * Fully qualified identifier of the resource. @@ -35,24 +35,14 @@ public class PrivateLinkResourceInner { @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; - /* - * e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or - * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery) - */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - - /* - * [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1] - */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) - private List requiredZoneNames; + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } /** * Get the id property: Fully qualified identifier of the resource. @@ -88,7 +78,7 @@ public String type() { * @return the groupId value. */ public String groupId() { - return this.groupId; + return this.innerProperties() == null ? null : this.innerProperties().groupId(); } /** @@ -97,7 +87,7 @@ public String groupId() { * @return the requiredMembers value. */ public List requiredMembers() { - return this.requiredMembers; + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); } /** @@ -106,7 +96,7 @@ public List requiredMembers() { * @return the requiredZoneNames value. */ public List requiredZoneNames() { - return this.requiredZoneNames; + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } /** @@ -115,5 +105,8 @@ public List requiredZoneNames() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..a677cf04d250f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private link resource. */ +@Immutable +public final class PrivateLinkResourceProperties { + /* + * e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or + * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery) + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1] + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the groupId property: e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or + * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery). + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java index f66c1db514a38..63dd19efbae51 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.models.JobsSummary; import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Replication usages of a vault. */ @Fluent public final class ReplicationUsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsageInner.class); - /* * Summary of the replication monitoring data for this vault. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java index dfcf5d161a7c3..be1d5c995d4b2 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.models.ResourceCertificateDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Certificate corresponding to a vault that can be used by clients to register themselves with the vault. */ @Fluent public final class VaultCertificateResponseInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificateResponseInner.class); - /* * Certificate details representing the Vault credentials. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfo.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfo.java new file mode 100644 index 0000000000000..24ec93e7470c7 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfo.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault extended information. */ +@Fluent +public final class VaultExtendedInfo { + /* + * Integrity key. + */ + @JsonProperty(value = "integrityKey") + private String integrityKey; + + /* + * Encryption key. + */ + @JsonProperty(value = "encryptionKey") + private String encryptionKey; + + /* + * Encryption key thumbprint. + */ + @JsonProperty(value = "encryptionKeyThumbprint") + private String encryptionKeyThumbprint; + + /* + * Algorithm for Vault ExtendedInfo + */ + @JsonProperty(value = "algorithm") + private String algorithm; + + /** + * Get the integrityKey property: Integrity key. + * + * @return the integrityKey value. + */ + public String integrityKey() { + return this.integrityKey; + } + + /** + * Set the integrityKey property: Integrity key. + * + * @param integrityKey the integrityKey value to set. + * @return the VaultExtendedInfo object itself. + */ + public VaultExtendedInfo withIntegrityKey(String integrityKey) { + this.integrityKey = integrityKey; + return this; + } + + /** + * Get the encryptionKey property: Encryption key. + * + * @return the encryptionKey value. + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: Encryption key. + * + * @param encryptionKey the encryptionKey value to set. + * @return the VaultExtendedInfo object itself. + */ + public VaultExtendedInfo withEncryptionKey(String encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the encryptionKeyThumbprint property: Encryption key thumbprint. + * + * @return the encryptionKeyThumbprint value. + */ + public String encryptionKeyThumbprint() { + return this.encryptionKeyThumbprint; + } + + /** + * Set the encryptionKeyThumbprint property: Encryption key thumbprint. + * + * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set. + * @return the VaultExtendedInfo object itself. + */ + public VaultExtendedInfo withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { + this.encryptionKeyThumbprint = encryptionKeyThumbprint; + return this; + } + + /** + * Get the algorithm property: Algorithm for Vault ExtendedInfo. + * + * @return the algorithm value. + */ + public String algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm property: Algorithm for Vault ExtendedInfo. + * + * @param algorithm the algorithm value to set. + * @return the VaultExtendedInfo object itself. + */ + public VaultExtendedInfo withAlgorithm(String algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java index 2a6489d1bec26..e4aad7c0b6e83 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java @@ -5,47 +5,52 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Vault extended information. */ -@JsonFlatten @Fluent -public class VaultExtendedInfoResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultExtendedInfoResourceInner.class); - +public final class VaultExtendedInfoResourceInner extends ProxyResource { /* - * Integrity key. + * Vault extended information. */ - @JsonProperty(value = "properties.integrityKey") - private String integrityKey; + @JsonProperty(value = "properties") + private VaultExtendedInfo innerProperties; /* - * Encryption key. + * Optional ETag. */ - @JsonProperty(value = "properties.encryptionKey") - private String encryptionKey; + @JsonProperty(value = "etag") + private String etag; - /* - * Encryption key thumbprint. + /** + * Get the innerProperties property: Vault extended information. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.encryptionKeyThumbprint") - private String encryptionKeyThumbprint; + private VaultExtendedInfo innerProperties() { + return this.innerProperties; + } - /* - * Algorithm for Vault ExtendedInfo + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. */ - @JsonProperty(value = "properties.algorithm") - private String algorithm; + public String etag() { + return this.etag; + } - /* - * Optional ETag. + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the VaultExtendedInfoResourceInner object itself. */ - @JsonProperty(value = "eTag") - private String etag; + public VaultExtendedInfoResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } /** * Get the integrityKey property: Integrity key. @@ -53,7 +58,7 @@ public class VaultExtendedInfoResourceInner extends ProxyResource { * @return the integrityKey value. */ public String integrityKey() { - return this.integrityKey; + return this.innerProperties() == null ? null : this.innerProperties().integrityKey(); } /** @@ -63,7 +68,10 @@ public String integrityKey() { * @return the VaultExtendedInfoResourceInner object itself. */ public VaultExtendedInfoResourceInner withIntegrityKey(String integrityKey) { - this.integrityKey = integrityKey; + if (this.innerProperties() == null) { + this.innerProperties = new VaultExtendedInfo(); + } + this.innerProperties().withIntegrityKey(integrityKey); return this; } @@ -73,7 +81,7 @@ public VaultExtendedInfoResourceInner withIntegrityKey(String integrityKey) { * @return the encryptionKey value. */ public String encryptionKey() { - return this.encryptionKey; + return this.innerProperties() == null ? null : this.innerProperties().encryptionKey(); } /** @@ -83,7 +91,10 @@ public String encryptionKey() { * @return the VaultExtendedInfoResourceInner object itself. */ public VaultExtendedInfoResourceInner withEncryptionKey(String encryptionKey) { - this.encryptionKey = encryptionKey; + if (this.innerProperties() == null) { + this.innerProperties = new VaultExtendedInfo(); + } + this.innerProperties().withEncryptionKey(encryptionKey); return this; } @@ -93,7 +104,7 @@ public VaultExtendedInfoResourceInner withEncryptionKey(String encryptionKey) { * @return the encryptionKeyThumbprint value. */ public String encryptionKeyThumbprint() { - return this.encryptionKeyThumbprint; + return this.innerProperties() == null ? null : this.innerProperties().encryptionKeyThumbprint(); } /** @@ -103,7 +114,10 @@ public String encryptionKeyThumbprint() { * @return the VaultExtendedInfoResourceInner object itself. */ public VaultExtendedInfoResourceInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { - this.encryptionKeyThumbprint = encryptionKeyThumbprint; + if (this.innerProperties() == null) { + this.innerProperties = new VaultExtendedInfo(); + } + this.innerProperties().withEncryptionKeyThumbprint(encryptionKeyThumbprint); return this; } @@ -113,7 +127,7 @@ public VaultExtendedInfoResourceInner withEncryptionKeyThumbprint(String encrypt * @return the algorithm value. */ public String algorithm() { - return this.algorithm; + return this.innerProperties() == null ? null : this.innerProperties().algorithm(); } /** @@ -123,27 +137,10 @@ public String algorithm() { * @return the VaultExtendedInfoResourceInner object itself. */ public VaultExtendedInfoResourceInner withAlgorithm(String algorithm) { - this.algorithm = algorithm; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the VaultExtendedInfoResourceInner object itself. - */ - public VaultExtendedInfoResourceInner withEtag(String etag) { - this.etag = etag; + if (this.innerProperties() == null) { + this.innerProperties = new VaultExtendedInfo(); + } + this.innerProperties().withAlgorithm(algorithm); return this; } @@ -153,5 +150,8 @@ public VaultExtendedInfoResourceInner withEtag(String etag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java index 7c26f78d82a69..c971c1b774982 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java @@ -6,19 +6,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.recoveryservices.models.IdentityData; import com.azure.resourcemanager.recoveryservices.models.Sku; import com.azure.resourcemanager.recoveryservices.models.VaultProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Resource information, as returned by the resource provider. */ @Fluent public final class VaultInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultInner.class); - /* * Identity for the resource. */ @@ -37,6 +34,12 @@ public final class VaultInner extends Resource { @JsonProperty(value = "sku") private Sku sku; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the identity property: Identity for the resource. * @@ -97,6 +100,15 @@ public VaultInner withSku(Sku sku) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public VaultInner withLocation(String location) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java index 6760967308e38..27e2b9076bce1 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.models.NameInfo; import com.azure.resourcemanager.recoveryservices.models.UsagesUnit; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Usages of a vault. */ @Fluent public final class VaultUsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultUsageInner.class); - /* * Unit of the usage. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java index aa46670c680f0..1e79442173568 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java @@ -4,17 +4,17 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityResult; public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { private CheckNameAvailabilityResultInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; CheckNameAvailabilityResultImpl( - CheckNameAvailabilityResultInner innerObject, RecoveryServicesManager serviceManager) { + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ public CheckNameAvailabilityResultInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java index a0981d42816e2..e63a23e609d41 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForProperties; @@ -13,10 +12,11 @@ public final class ClientDiscoveryValueForSingleApiImpl implements ClientDiscoveryValueForSingleApi { private ClientDiscoveryValueForSingleApiInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; ClientDiscoveryValueForSingleApiImpl( - ClientDiscoveryValueForSingleApiInner innerObject, RecoveryServicesManager serviceManager) { + ClientDiscoveryValueForSingleApiInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -41,7 +41,7 @@ public ClientDiscoveryValueForSingleApiInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationResourceImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationResourceImpl.java new file mode 100644 index 0000000000000..5a069ebf8e35e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationResourceImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.recoveryservices.models.OperationResource; +import java.time.OffsetDateTime; + +public final class OperationResourceImpl implements OperationResource { + private OperationResourceInner innerObject; + + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; + + OperationResourceImpl( + OperationResourceInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OperationResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java index ed1d7cdb0ce67..987eec02b26c6 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.OperationsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryResponse; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -108,7 +106,7 @@ private Mono> listSinglePag res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -118,7 +116,8 @@ private Mono> listSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,8 @@ private Mono> listSinglePag * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +162,8 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +176,8 @@ private PagedFlux listAsync(Context conte * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +191,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +206,8 @@ public PagedIterable list(Context context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -228,7 +232,7 @@ private Mono> listNextSingl res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -239,7 +243,8 @@ private Mono> listNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java index 4ebae3e740cbc..6a0e7dc64e4e0 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java @@ -7,40 +7,40 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.OperationsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryValueForSingleApi; import com.azure.resourcemanager.recoveryservices.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public OperationsImpl(OperationsClient innerClient, RecoveryServicesManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return inner.mapPage(inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return inner.mapPage(inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); } private OperationsClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java index 61b0f0a3718bc..ab67030f7269b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResource; import java.util.Collections; @@ -13,9 +12,11 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private PrivateLinkResourceInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, RecoveryServicesManager serviceManager) { + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -58,7 +59,7 @@ public PrivateLinkResourceInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java index 49fde72c0b025..73c597fbfe23f 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.PrivateLinkResourcesOperationsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResources; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in PrivateLinkResourcesOperationsClient. */ public final class PrivateLinkResourcesOperationsClientImpl implements PrivateLinkResourcesOperationsClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesOperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateLinkResourcesOperationsService service; @@ -113,7 +110,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -159,7 +157,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -171,7 +169,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -225,7 +224,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String vaultName) { @@ -242,7 +241,7 @@ private PagedFlux listAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { @@ -259,7 +258,8 @@ private PagedFlux listAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String vaultName) { @@ -275,7 +275,8 @@ public PagedIterable list(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String vaultName, Context context) { @@ -291,7 +292,8 @@ public PagedIterable list(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -334,7 +336,7 @@ private Mono> getWithResponseAsync( privateLinkResourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -347,7 +349,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -399,7 +402,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -441,7 +444,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String vaultName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -456,7 +459,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -481,7 +485,7 @@ private Mono> listNextSinglePageAsync(St res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -492,7 +496,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java index 4e31a2abc9b68..3d98abf9c673e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java @@ -9,35 +9,34 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.PrivateLinkResourcesOperationsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResource; import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResourcesOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateLinkResourcesOperationsImpl implements PrivateLinkResourcesOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesOperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesOperationsImpl.class); private final PrivateLinkResourcesOperationsClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; public PrivateLinkResourcesOperationsImpl( - PrivateLinkResourcesOperationsClient innerClient, RecoveryServicesManager serviceManager) { + PrivateLinkResourcesOperationsClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String vaultName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); - return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String vaultName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); - return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } public PrivateLinkResource get(String resourceGroupName, String vaultName, String privateLinkResourceName) { @@ -69,7 +68,7 @@ private PrivateLinkResourcesOperationsClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java index 0a81507c431e5..157f6ea21267d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java @@ -22,7 +22,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; @@ -30,8 +29,6 @@ /** An instance of this class provides access to all the operations defined in RecoveryServicesClient. */ public final class RecoveryServicesClientImpl implements RecoveryServicesClient { - private final ClientLogger logger = new ClientLogger(RecoveryServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RecoveryServicesService service; @@ -84,7 +81,8 @@ Mono> checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -127,7 +125,7 @@ private Mono> checkNameAvailabilityWi input, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -142,7 +140,8 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -196,7 +195,7 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -243,7 +242,7 @@ public CheckNameAvailabilityResultInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java index 2f4c179924caa..df65e7373806a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java @@ -8,22 +8,22 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityResult; import com.azure.resourcemanager.recoveryservices.models.RecoveryServices; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RecoveryServicesImpl implements RecoveryServices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RecoveryServicesImpl.class); private final RecoveryServicesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public RecoveryServicesImpl(RecoveryServicesClient innerClient, RecoveryServicesManager serviceManager) { + public RecoveryServicesImpl( + RecoveryServicesClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -58,7 +58,7 @@ private RecoveryServicesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java index 73ec143fc2ce9..3b6a0e02d8329 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java @@ -27,6 +27,7 @@ import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesManagementClient; import com.azure.resourcemanager.recoveryservices.fluent.RegisteredIdentitiesClient; import com.azure.resourcemanager.recoveryservices.fluent.ReplicationUsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.ResourceProvidersClient; import com.azure.resourcemanager.recoveryservices.fluent.UsagesClient; import com.azure.resourcemanager.recoveryservices.fluent.VaultCertificatesClient; import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; @@ -44,8 +45,6 @@ /** Initializes a new instance of the RecoveryServicesManagementClientImpl type. */ @ServiceClient(builder = RecoveryServicesManagementClientBuilder.class) public final class RecoveryServicesManagementClientImpl implements RecoveryServicesManagementClient { - private final ClientLogger logger = new ClientLogger(RecoveryServicesManagementClientImpl.class); - /** The subscription Id. */ private final String subscriptionId; @@ -214,6 +213,18 @@ public VaultExtendedInfoesClient getVaultExtendedInfoes() { return this.vaultExtendedInfoes; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + /** The UsagesClient object to access its operations. */ private final UsagesClient usages; @@ -248,7 +259,7 @@ public UsagesClient getUsages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2016-06-01"; + this.apiVersion = "2022-02-01"; this.vaultCertificates = new VaultCertificatesClientImpl(this); this.registeredIdentities = new RegisteredIdentitiesClientImpl(this); this.replicationUsages = new ReplicationUsagesClientImpl(this); @@ -257,6 +268,7 @@ public UsagesClient getUsages() { this.vaults = new VaultsClientImpl(this); this.operations = new OperationsClientImpl(this); this.vaultExtendedInfoes = new VaultExtendedInfoesClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); this.usages = new UsagesClientImpl(this); } @@ -342,8 +354,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } - } catch (IOException ioe) { - logger.logThrowableAsWarning(ioe); + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -371,7 +383,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -402,4 +414,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryServicesManagementClientImpl.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java index 205ec3f49aee7..a238d8ce7a487 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java @@ -20,14 +20,11 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.RegisteredIdentitiesClient; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in RegisteredIdentitiesClient. */ public final class RegisteredIdentitiesClientImpl implements RegisteredIdentitiesClient { - private final ClientLogger logger = new ClientLogger(RegisteredIdentitiesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RegisteredIdentitiesService service; @@ -78,7 +75,7 @@ Mono> delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -117,7 +114,7 @@ private Mono> deleteWithResponseAsync( vaultName, identityName, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -130,7 +127,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -178,7 +175,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String vaultName, String identityName) { @@ -211,7 +208,7 @@ public void delete(String resourceGroupName, String vaultName, String identityNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java index b7936e9800eb0..b80ab29cd5700 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java @@ -7,19 +7,19 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.RegisteredIdentitiesClient; import com.azure.resourcemanager.recoveryservices.models.RegisteredIdentities; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RegisteredIdentitiesImpl implements RegisteredIdentities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredIdentitiesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RegisteredIdentitiesImpl.class); private final RegisteredIdentitiesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public RegisteredIdentitiesImpl(RegisteredIdentitiesClient innerClient, RecoveryServicesManager serviceManager) { + public RegisteredIdentitiesImpl( + RegisteredIdentitiesClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -37,7 +37,7 @@ private RegisteredIdentitiesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java index 897377356682a..f2c067f0ca925 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; import com.azure.resourcemanager.recoveryservices.models.JobsSummary; import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary; @@ -13,9 +12,11 @@ public final class ReplicationUsageImpl implements ReplicationUsage { private ReplicationUsageInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - ReplicationUsageImpl(ReplicationUsageInner innerObject, RecoveryServicesManager serviceManager) { + ReplicationUsageImpl( + ReplicationUsageInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -48,7 +49,7 @@ public ReplicationUsageInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java index 8df6493090ac0..aebe08e3401a3 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.ReplicationUsagesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; import com.azure.resourcemanager.recoveryservices.models.ReplicationUsageList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ReplicationUsagesClient. */ public final class ReplicationUsagesClientImpl implements ReplicationUsagesClient { - private final ClientLogger logger = new ClientLogger(ReplicationUsagesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReplicationUsagesService service; @@ -83,7 +80,7 @@ Mono> list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String vaultName) { @@ -123,7 +120,7 @@ private Mono> listSinglePageAsync(String re res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -135,7 +132,7 @@ private Mono> listSinglePageAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -184,7 +181,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String vaultName) { @@ -200,7 +197,7 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { @@ -215,7 +212,7 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String vaultName) { @@ -231,7 +228,7 @@ public PagedIterable list(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String vaultName, Context context) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java index ef0eec19a1cf8..8c5d5695674a8 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java @@ -7,40 +7,40 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.ReplicationUsagesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; import com.azure.resourcemanager.recoveryservices.models.ReplicationUsage; import com.azure.resourcemanager.recoveryservices.models.ReplicationUsages; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReplicationUsagesImpl implements ReplicationUsages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsagesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReplicationUsagesImpl.class); private final ReplicationUsagesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public ReplicationUsagesImpl(ReplicationUsagesClient innerClient, RecoveryServicesManager serviceManager) { + public ReplicationUsagesImpl( + ReplicationUsagesClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String vaultName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); - return inner.mapPage(inner1 -> new ReplicationUsageImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new ReplicationUsageImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String vaultName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); - return inner.mapPage(inner1 -> new ReplicationUsageImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new ReplicationUsageImpl(inner1, this.manager())); } private ReplicationUsagesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..60e7c916aad28 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.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.recoveryservices.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/operationStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOperationStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOperationResult( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String resourceGroupName, String vaultName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOperationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String resourceGroupName, String vaultName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOperationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationStatusAsync( + String resourceGroupName, String vaultName, String operationId) { + return getOperationStatusWithResponseAsync(resourceGroupName, vaultName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner getOperationStatus(String resourceGroupName, String vaultName, String operationId) { + return getOperationStatusAsync(resourceGroupName, vaultName, operationId).block(); + } + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getOperationStatusWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); + } + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationResultWithResponseAsync( + String resourceGroupName, String vaultName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOperationResult( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationResultWithResponseAsync( + String resourceGroupName, String vaultName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOperationResult( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationResultAsync(String resourceGroupName, String vaultName, String operationId) { + return getOperationResultWithResponseAsync(resourceGroupName, vaultName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner getOperationResult(String resourceGroupName, String vaultName, String operationId) { + return getOperationResultAsync(resourceGroupName, vaultName, operationId).block(); + } + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationResultWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getOperationResultWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..9ce8e86d5f322 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ResourceProvidersImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import com.azure.resourcemanager.recoveryservices.models.OperationResource; +import com.azure.resourcemanager.recoveryservices.models.ResourceProviders; +import com.azure.resourcemanager.recoveryservices.models.Vault; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResource getOperationStatus(String resourceGroupName, String vaultName, String operationId) { + OperationResourceInner inner = + this.serviceClient().getOperationStatus(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOperationStatusWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + Response inner = + this.serviceClient().getOperationStatusWithResponse(resourceGroupName, vaultName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Vault getOperationResult(String resourceGroupName, String vaultName, String operationId) { + VaultInner inner = this.serviceClient().getOperationResult(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new VaultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOperationResultWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + Response inner = + this.serviceClient().getOperationResultWithResponse(resourceGroupName, vaultName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java index 2a580ba90e530..8e2c4a2dba407 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.UsagesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; import com.azure.resourcemanager.recoveryservices.models.VaultUsageList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in UsagesClient. */ public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final UsagesService service; @@ -82,7 +79,7 @@ Mono> listByVaults( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVaultsSinglePageAsync( @@ -123,7 +120,7 @@ private Mono> listByVaultsSinglePageAsync( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -135,7 +132,7 @@ private Mono> listByVaultsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVaultsSinglePageAsync( @@ -184,7 +181,7 @@ private Mono> listByVaultsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByVaultsAsync(String resourceGroupName, String vaultName) { @@ -200,7 +197,7 @@ private PagedFlux listByVaultsAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByVaultsAsync(String resourceGroupName, String vaultName, Context context) { @@ -215,7 +212,7 @@ private PagedFlux listByVaultsAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByVaults(String resourceGroupName, String vaultName) { @@ -231,7 +228,7 @@ public PagedIterable listByVaults(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java index ab8988c3b9950..43955a26ebdb1 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java @@ -7,40 +7,39 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.UsagesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; import com.azure.resourcemanager.recoveryservices.models.Usages; import com.azure.resourcemanager.recoveryservices.models.VaultUsage; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class UsagesImpl implements Usages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); private final UsagesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public UsagesImpl(UsagesClient innerClient, RecoveryServicesManager serviceManager) { + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByVaults(String resourceGroupName, String vaultName) { PagedIterable inner = this.serviceClient().listByVaults(resourceGroupName, vaultName); - return inner.mapPage(inner1 -> new VaultUsageImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultUsageImpl(inner1, this.manager())); } public PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context) { PagedIterable inner = this.serviceClient().listByVaults(resourceGroupName, vaultName, context); - return inner.mapPage(inner1 -> new VaultUsageImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultUsageImpl(inner1, this.manager())); } private UsagesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java index 59bc1e9d88f0f..177f5ec5a638e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java @@ -4,12 +4,20 @@ package com.azure.resourcemanager.recoveryservices.implementation; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -64,4 +72,133 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } return null; } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java index 80f2bbe1518df..c25a10862eb07 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner; import com.azure.resourcemanager.recoveryservices.models.CertificateRequest; import com.azure.resourcemanager.recoveryservices.models.RawCertificateData; @@ -16,9 +15,11 @@ public final class VaultCertificateResponseImpl implements VaultCertificateResponse, VaultCertificateResponse.Definition { private VaultCertificateResponseInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - VaultCertificateResponseImpl(VaultCertificateResponseInner innerObject, RecoveryServicesManager serviceManager) { + VaultCertificateResponseImpl( + VaultCertificateResponseInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -43,7 +44,7 @@ public VaultCertificateResponseInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } @@ -82,7 +83,8 @@ public VaultCertificateResponse create(Context context) { return this; } - VaultCertificateResponseImpl(String name, RecoveryServicesManager serviceManager) { + VaultCertificateResponseImpl( + String name, com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = new VaultCertificateResponseInner(); this.serviceManager = serviceManager; this.certificateName = name; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java index a846367624e94..f89c555a5b356 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java @@ -22,7 +22,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.VaultCertificatesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner; import com.azure.resourcemanager.recoveryservices.models.CertificateRequest; @@ -30,8 +29,6 @@ /** An instance of this class provides access to all the operations defined in VaultCertificatesClient. */ public final class VaultCertificatesClientImpl implements VaultCertificatesClient { - private final ClientLogger logger = new ClientLogger(VaultCertificatesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final VaultCertificatesService service; @@ -84,7 +81,8 @@ Mono> create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -133,7 +131,7 @@ private Mono> createWithResponseAsync( certificateRequest, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -147,7 +145,8 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -210,7 +209,8 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -255,7 +255,8 @@ public VaultCertificateResponseInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java index 9d19a96a85cad..fdea9a0bcc82c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java @@ -5,19 +5,19 @@ package com.azure.resourcemanager.recoveryservices.implementation; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.VaultCertificatesClient; import com.azure.resourcemanager.recoveryservices.models.VaultCertificates; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class VaultCertificatesImpl implements VaultCertificates { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificatesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(VaultCertificatesImpl.class); private final VaultCertificatesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public VaultCertificatesImpl(VaultCertificatesClient innerClient, RecoveryServicesManager serviceManager) { + public VaultCertificatesImpl( + VaultCertificatesClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -26,7 +26,7 @@ private VaultCertificatesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java index 39f747ebc18d2..874f8cfcce600 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java @@ -4,16 +4,17 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoResource; public final class VaultExtendedInfoResourceImpl implements VaultExtendedInfoResource { private VaultExtendedInfoResourceInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - VaultExtendedInfoResourceImpl(VaultExtendedInfoResourceInner innerObject, RecoveryServicesManager serviceManager) { + VaultExtendedInfoResourceImpl( + VaultExtendedInfoResourceInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -30,6 +31,10 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + public String integrityKey() { return this.innerModel().integrityKey(); } @@ -46,15 +51,11 @@ public String algorithm() { return this.innerModel().algorithm(); } - public String etag() { - return this.innerModel().etag(); - } - public VaultExtendedInfoResourceInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java index d25a7f7225a98..2a57dcb076d76 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java @@ -24,15 +24,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VaultExtendedInfoesClient. */ public final class VaultExtendedInfoesClientImpl implements VaultExtendedInfoesClient { - private final ClientLogger logger = new ClientLogger(VaultExtendedInfoesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final VaultExtendedInfoesService service; @@ -113,7 +110,7 @@ Mono> update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -150,7 +147,7 @@ private Mono> getWithResponseAsync( vaultName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -162,7 +159,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -207,7 +204,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String vaultName) { @@ -246,7 +243,7 @@ public VaultExtendedInfoResourceInner get(String resourceGroupName, String vault * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -263,7 +260,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -309,7 +306,7 @@ private Mono> createOrUpdateWithRespons resourceExtendedInfoDetails, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -322,7 +319,7 @@ private Mono> createOrUpdateWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -380,7 +377,7 @@ private Mono> createOrUpdateWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -423,7 +420,7 @@ public VaultExtendedInfoResourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -444,7 +441,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -490,7 +487,7 @@ private Mono> updateWithResponseAsync( resourceExtendedInfoDetails, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -503,7 +500,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -561,7 +558,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -604,7 +601,7 @@ public VaultExtendedInfoResourceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java index 98e535d471b3e..4458a57da9743 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java @@ -8,21 +8,21 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoResource; import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class VaultExtendedInfoesImpl implements VaultExtendedInfoes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultExtendedInfoesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(VaultExtendedInfoesImpl.class); private final VaultExtendedInfoesClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public VaultExtendedInfoesImpl(VaultExtendedInfoesClient innerClient, RecoveryServicesManager serviceManager) { + public VaultExtendedInfoesImpl( + VaultExtendedInfoesClient innerClient, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -115,7 +115,7 @@ private VaultExtendedInfoesClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java index d14a068b84caa..e006e29f2de4e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.recoveryservices.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; import com.azure.resourcemanager.recoveryservices.models.IdentityData; import com.azure.resourcemanager.recoveryservices.models.PatchVault; @@ -19,7 +19,7 @@ public final class VaultImpl implements Vault, Vault.Definition, Vault.Update { private VaultInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -58,6 +58,10 @@ public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -70,7 +74,7 @@ public VaultInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } @@ -90,8 +94,7 @@ public Vault create() { serviceManager .serviceClient() .getVaults() - .createOrUpdateWithResponse(resourceGroupName, vaultName, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, vaultName, this.innerModel(), Context.NONE); return this; } @@ -100,12 +103,11 @@ public Vault create(Context context) { serviceManager .serviceClient() .getVaults() - .createOrUpdateWithResponse(resourceGroupName, vaultName, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, vaultName, this.innerModel(), context); return this; } - VaultImpl(String name, RecoveryServicesManager serviceManager) { + VaultImpl(String name, com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = new VaultInner(); this.serviceManager = serviceManager; this.vaultName = name; @@ -118,25 +120,18 @@ public VaultImpl update() { public Vault apply() { this.innerObject = - serviceManager - .serviceClient() - .getVaults() - .updateWithResponse(resourceGroupName, vaultName, updateVault, Context.NONE) - .getValue(); + serviceManager.serviceClient().getVaults().update(resourceGroupName, vaultName, updateVault, Context.NONE); return this; } public Vault apply(Context context) { this.innerObject = - serviceManager - .serviceClient() - .getVaults() - .updateWithResponse(resourceGroupName, vaultName, updateVault, context) - .getValue(); + serviceManager.serviceClient().getVaults().update(resourceGroupName, vaultName, updateVault, context); return this; } - VaultImpl(VaultInner innerObject, RecoveryServicesManager serviceManager) { + VaultImpl( + VaultInner innerObject, com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java index 1076156b80f49..b5d94308cc8b1 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.recoveryservices.implementation; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; import com.azure.resourcemanager.recoveryservices.models.NameInfo; import com.azure.resourcemanager.recoveryservices.models.UsagesUnit; @@ -14,9 +13,11 @@ public final class VaultUsageImpl implements VaultUsage { private VaultUsageInner innerObject; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - VaultUsageImpl(VaultUsageInner innerObject, RecoveryServicesManager serviceManager) { + VaultUsageImpl( + VaultUsageInner innerObject, + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -49,7 +50,7 @@ public VaultUsageInner innerModel() { return this.innerObject; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java index 3b15c7a58b6cc..3f9dbd50c83fe 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java @@ -27,19 +27,21 @@ 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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.recoveryservices.fluent.VaultsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; import com.azure.resourcemanager.recoveryservices.models.PatchVault; import com.azure.resourcemanager.recoveryservices.models.VaultList; +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 VaultsClient. */ public final class VaultsClientImpl implements VaultsClient { - private final ClientLogger logger = new ClientLogger(VaultsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final VaultsService service; @@ -109,7 +111,7 @@ Mono> getByResourceGroup( + "/vaults/{vaultName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @@ -119,7 +121,7 @@ Mono> createOrUpdate( @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/vaults/{vaultName}") @@ -131,15 +133,16 @@ Mono> delete( @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + "/vaults/{vaultName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @@ -175,7 +178,8 @@ Mono> listByResourceGroupNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -211,7 +215,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -221,7 +225,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -262,7 +267,7 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -277,7 +282,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -290,7 +295,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -304,7 +309,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -318,7 +323,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -359,7 +365,7 @@ private Mono> listByResourceGroupSinglePageAsync(Strin res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -370,7 +376,8 @@ private Mono> listByResourceGroupSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -419,7 +426,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -436,7 +443,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -452,7 +459,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -467,7 +474,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -482,7 +489,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, C * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName) { @@ -518,7 +525,7 @@ private Mono> getByResourceGroupWithResponseAsync(String re vaultName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -530,7 +537,7 @@ private Mono> getByResourceGroupWithResponseAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -575,7 +582,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { @@ -614,7 +621,7 @@ public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -631,10 +638,11 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return resource information, as returned by the resource provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( + private Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vaultName, VaultInner vault) { if (this.client.getEndpoint() == null) { return Mono @@ -674,7 +682,7 @@ private Mono> createOrUpdateWithResponseAsync( vault, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -687,10 +695,11 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return resource information, as returned by the resource provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( + private Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vaultName, VaultInner vault, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -739,19 +748,113 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return the {@link PollerFlux} for polling of resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vaultName, VaultInner vault) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, this.client.getContext()); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vaultName, VaultInner vault, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, context); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultInner vault) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, vault).getSyncPoller(); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultInner vault, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, vault, context).getSyncPoller(); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, as returned by the resource provider on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String vaultName, VaultInner vault) { - return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, vault) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, as returned by the resource provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, VaultInner vault, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, vault, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -783,9 +886,8 @@ public VaultInner createOrUpdate(String resourceGroupName, String vaultName, Vau * @return resource information, as returned by the resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String vaultName, VaultInner vault, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault, context).block(); + public VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultInner vault, Context context) { + return createOrUpdateAsync(resourceGroupName, vaultName, vault, context).block(); } /** @@ -796,7 +898,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName) { @@ -819,6 +921,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -829,8 +932,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S this.client.getApiVersion(), resourceGroupName, vaultName, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -842,7 +946,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { @@ -865,6 +969,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -873,6 +978,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S this.client.getApiVersion(), resourceGroupName, vaultName, + accept, context); } @@ -884,7 +990,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String vaultName) { @@ -914,7 +1020,7 @@ public void delete(String resourceGroupName, String vaultName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { @@ -930,10 +1036,11 @@ public Response deleteWithResponse(String resourceGroupName, String vaultN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return resource information, as returned by the resource provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String vaultName, PatchVault vault) { if (this.client.getEndpoint() == null) { return Mono @@ -973,7 +1080,7 @@ private Mono> updateWithResponseAsync( vault, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -986,10 +1093,11 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return resource information, as returned by the resource provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String vaultName, PatchVault vault, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1038,19 +1146,112 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, as returned by the resource provider. + * @return the {@link PollerFlux} for polling of resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginUpdateAsync( + String resourceGroupName, String vaultName, PatchVault vault) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, vault); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, this.client.getContext()); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginUpdateAsync( + String resourceGroupName, String vaultName, PatchVault vault, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, vault, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, context); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginUpdate( + String resourceGroupName, String vaultName, PatchVault vault) { + return beginUpdateAsync(resourceGroupName, vaultName, vault).getSyncPoller(); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginUpdate( + String resourceGroupName, String vaultName, PatchVault vault, Context context) { + return beginUpdateAsync(resourceGroupName, vaultName, vault, context).getSyncPoller(); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, as returned by the resource provider on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String vaultName, PatchVault vault) { - return updateWithResponseAsync(resourceGroupName, vaultName, vault) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginUpdateAsync(resourceGroupName, vaultName, vault) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Recovery Services Vault to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, as returned by the resource provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vaultName, PatchVault vault, Context context) { + return beginUpdateAsync(resourceGroupName, vaultName, vault, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1082,9 +1283,8 @@ public VaultInner update(String resourceGroupName, String vaultName, PatchVault * @return resource information, as returned by the resource provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String vaultName, PatchVault vault, Context context) { - return updateWithResponseAsync(resourceGroupName, vaultName, vault, context).block(); + public VaultInner update(String resourceGroupName, String vaultName, PatchVault vault, Context context) { + return updateAsync(resourceGroupName, vaultName, vault, context).block(); } /** @@ -1094,7 +1294,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink) { @@ -1120,7 +1321,7 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1131,7 +1332,8 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink, Context context) { @@ -1166,7 +1368,8 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1192,7 +1395,7 @@ private Mono> listByResourceGroupNextSinglePageAsync(S res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1203,7 +1406,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java index ddd785de7ea05..988453b19b2e7 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java @@ -9,43 +9,42 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; import com.azure.resourcemanager.recoveryservices.fluent.VaultsClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; import com.azure.resourcemanager.recoveryservices.models.Vault; import com.azure.resourcemanager.recoveryservices.models.Vaults; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class VaultsImpl implements Vaults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(VaultsImpl.class); private final VaultsClient innerClient; - private final RecoveryServicesManager serviceManager; + private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager; - public VaultsImpl(VaultsClient innerClient, RecoveryServicesManager serviceManager) { + public VaultsImpl( + VaultsClient innerClient, com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); } public Vault getByResourceGroup(String resourceGroupName, String vaultName) { @@ -82,7 +81,7 @@ public Response deleteWithResponse(String resourceGroupName, String vaultN public Vault getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -90,7 +89,7 @@ public Vault getById(String id) { } String vaultName = Utils.getValueFromIdByName(id, "vaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); @@ -101,7 +100,7 @@ public Vault getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -109,7 +108,7 @@ public Response getByIdWithResponse(String id, Context context) { } String vaultName = Utils.getValueFromIdByName(id, "vaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); @@ -120,7 +119,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,18 +127,18 @@ public void deleteById(String id) { } String vaultName = Utils.getValueFromIdByName(id, "vaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); } - this.deleteWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, vaultName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -147,7 +146,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String vaultName = Utils.getValueFromIdByName(id, "vaults"); if (vaultName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); @@ -159,7 +158,7 @@ private VaultsClient serviceClient() { return this.innerClient; } - private RecoveryServicesManager manager() { + private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() { return this.serviceManager; } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BackupStorageVersion.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BackupStorageVersion.java new file mode 100644 index 0000000000000..f6719c5bc5459 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BackupStorageVersion.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupStorageVersion. */ +public final class BackupStorageVersion extends ExpandableStringEnum { + /** Static value V1 for BackupStorageVersion. */ + public static final BackupStorageVersion V1 = fromString("V1"); + + /** Static value V2 for BackupStorageVersion. */ + public static final BackupStorageVersion V2 = fromString("V2"); + + /** Static value Unassigned for BackupStorageVersion. */ + public static final BackupStorageVersion UNASSIGNED = fromString("Unassigned"); + + /** + * Creates or finds a BackupStorageVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupStorageVersion. + */ + @JsonCreator + public static BackupStorageVersion fromString(String name) { + return fromString(name, BackupStorageVersion.class); + } + + /** @return known BackupStorageVersion values. */ + public static Collection values() { + return values(BackupStorageVersion.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java index 8c0ed6d8051d3..53a73d9822e4c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Details of the certificate to be uploaded to the vault. */ @Fluent public final class CertificateRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateRequest.class); - /* * Raw certificate data. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java index 30a208e751e21..95f614c49317a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Resource Name availability input parameters - Resource type and resource name. */ @Fluent public final class CheckNameAvailabilityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameters.class); - /* * Describes the Resource type: Microsoft.RecoveryServices/Vaults */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java index b23f032196c23..0f2eac4e1aede 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Localized display information of an operation. */ @Fluent public final class ClientDiscoveryDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryDisplay.class); - /* * Name of the provider for display purposes */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java index 1125f2db4a8b9..768d29d8d0856 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Class to represent shoebox log specification in json client discovery. */ @Fluent public final class ClientDiscoveryForLogSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForLogSpecification.class); - /* * Name of the log. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java index e24e3c13ef69d..5f999426d3da2 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Class to represent shoebox properties in json client discovery. */ @Fluent public final class ClientDiscoveryForProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForProperties.class); - /* * Operation properties. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java index ccb0492a4eeb9..76f1fb235f3d8 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Class to represent shoebox service specification in json client discovery. */ @Fluent public final class ClientDiscoveryForServiceSpecification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForServiceSpecification.class); - /* * List of log specifications of this operation. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java index 9c5c78d278384..9f1f02341d1da 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Operations List response which contains list of available APIs. */ @Fluent public final class ClientDiscoveryResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryResponse.class); - /* * List of available operations. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKekIdentity.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKekIdentity.java new file mode 100644 index 0000000000000..802ba217e3034 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKekIdentity.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The details of the identity used for CMK. */ +@Fluent +public class CmkKekIdentity { + /* + * Indicate that system assigned identity should be used. Mutually + * exclusive with 'userAssignedIdentity' field + */ + @JsonProperty(value = "useSystemAssignedIdentity") + private Boolean useSystemAssignedIdentity; + + /* + * The user assigned identity to be used to grant permissions in case the + * type of identity used is UserAssigned + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /** + * Get the useSystemAssignedIdentity property: Indicate that system assigned identity should be used. Mutually + * exclusive with 'userAssignedIdentity' field. + * + * @return the useSystemAssignedIdentity value. + */ + public Boolean useSystemAssignedIdentity() { + return this.useSystemAssignedIdentity; + } + + /** + * Set the useSystemAssignedIdentity property: Indicate that system assigned identity should be used. Mutually + * exclusive with 'userAssignedIdentity' field. + * + * @param useSystemAssignedIdentity the useSystemAssignedIdentity value to set. + * @return the CmkKekIdentity object itself. + */ + public CmkKekIdentity withUseSystemAssignedIdentity(Boolean useSystemAssignedIdentity) { + this.useSystemAssignedIdentity = useSystemAssignedIdentity; + return this; + } + + /** + * Get the userAssignedIdentity property: The user assigned identity to be used to grant permissions in case the + * type of identity used is UserAssigned. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user assigned identity to be used to grant permissions in case the + * type of identity used is UserAssigned. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the CmkKekIdentity object itself. + */ + public CmkKekIdentity withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKeyVaultProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKeyVaultProperties.java new file mode 100644 index 0000000000000..17aaac74db8a5 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CmkKeyVaultProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the Key Vault which hosts CMK. */ +@Fluent +public final class CmkKeyVaultProperties { + /* + * The key uri of the Customer Managed Key + */ + @JsonProperty(value = "keyUri") + private String keyUri; + + /** + * Get the keyUri property: The key uri of the Customer Managed Key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: The key uri of the Customer Managed Key. + * + * @param keyUri the keyUri value to set. + * @return the CmkKeyVaultProperties object itself. + */ + public CmkKeyVaultProperties withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java index e1c30df92c49b..d9cd28404201c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java @@ -6,14 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Identity for the resource. */ @Fluent public final class IdentityData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityData.class); - /* * The principal ID of resource identity. */ @@ -27,11 +26,23 @@ public final class IdentityData { private String tenantId; /* - * The identity type. + * The type of managed identity used. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user-assigned identities. The type 'None' will remove any identities. */ @JsonProperty(value = "type", required = true) private ResourceIdentityType type; + /* + * The list of user-assigned identities associated with the resource. The + * user-assigned identity dictionary keys will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + /** * Get the principalId property: The principal ID of resource identity. * @@ -51,7 +62,8 @@ public String tenantId() { } /** - * Get the type property: The identity type. + * Get the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. * * @return the type value. */ @@ -60,7 +72,8 @@ public ResourceIdentityType type() { } /** - * Set the type property: The identity type. + * Set the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. * * @param type the type value to set. * @return the IdentityData object itself. @@ -70,6 +83,30 @@ public IdentityData withType(ResourceIdentityType type) { return this; } + /** + * Get the userAssignedIdentities property: The list of user-assigned identities associated with the resource. The + * user-assigned identity dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user-assigned identities associated with the resource. The + * user-assigned identity dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityData object itself. + */ + public IdentityData withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + /** * Validates the instance. * @@ -77,9 +114,21 @@ public IdentityData withType(ResourceIdentityType type) { */ public void validate() { if (type() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property type in model IdentityData")); } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } + + private static final ClientLogger LOGGER = new ClientLogger(IdentityData.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/InfrastructureEncryptionState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/InfrastructureEncryptionState.java new file mode 100644 index 0000000000000..0e07676195c52 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/InfrastructureEncryptionState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InfrastructureEncryptionState. */ +public final class InfrastructureEncryptionState extends ExpandableStringEnum { + /** Static value Enabled for InfrastructureEncryptionState. */ + public static final InfrastructureEncryptionState ENABLED = fromString("Enabled"); + + /** Static value Disabled for InfrastructureEncryptionState. */ + public static final InfrastructureEncryptionState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a InfrastructureEncryptionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InfrastructureEncryptionState. + */ + @JsonCreator + public static InfrastructureEncryptionState fromString(String name) { + return fromString(name, InfrastructureEncryptionState.class); + } + + /** @return known InfrastructureEncryptionState values. */ + public static Collection values() { + return values(InfrastructureEncryptionState.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java index 6b1221a5c5e0f..78cff8bf70a5f 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Summary of the replication job data for this vault. */ @Fluent public final class JobsSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsSummary.class); - /* * Count of failed jobs. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java index ad31d83e1bbf8..3595904e78b82 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Summary of the replication monitoring data for this vault. */ @Fluent public final class MonitoringSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoringSummary.class); - /* * Count of unhealthy VMs. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java index 6199c06ee638f..d618e20a15118 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The name of usage. */ @Fluent public final class NameInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameInfo.class); - /* * Value of usage. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/OperationResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/OperationResource.java new file mode 100644 index 0000000000000..a62bda1dc3640 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/OperationResource.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationResource. */ +public interface OperationResource { + /** + * Gets the endTime property: End time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: Required if status == failed or status == canceled. This is the OData v4 error format, + * used by the RPC and will go into the v2.2 Azure REST API guidelines. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the id property: It should match what is used to GET the operation result. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: It must match the last segment of the "id" field, and will typically be a GUID / system + * generated value. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: The status of the operation. (InProgress/Success/Failed/Cancelled). + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner object. + * + * @return the inner object. + */ + OperationResourceInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java index 103ba94baf339..3135b12f434bb 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java @@ -14,7 +14,8 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -25,7 +26,8 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs. + * @return operations List response which contains list of available APIs as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java index 7375d3bcd66de..7609563f2983c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java @@ -6,16 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Tracked resource with location. */ @Fluent public class PatchTrackedResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchTrackedResource.class); - /* * Resource location. */ @@ -26,12 +23,13 @@ public class PatchTrackedResource extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Optional ETag. */ - @JsonProperty(value = "eTag") + @JsonProperty(value = "etag") private String etag; /** diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java index b368d235b9e74..7fc7231d13a39 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Patch Resource information, as returned by the resource provider. */ @Fluent public final class PatchVault extends PatchTrackedResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchVault.class); - /* * Properties of the vault. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java index 3acc2d7e435da..fe6450f58ce64 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint network resource that is linked to the Private Endpoint connection. */ @Immutable public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - /* * Gets or sets id. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java index 86ad609ad619b..ff939609494df 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Private Endpoint Connection Response Properties. */ @Immutable public final class PrivateEndpointConnection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnection.class); - /* * Gets or sets provisioning state of the private endpoint connection. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java index c2b2919356879..adaf305618ef5 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Information to be stored in Vault properties as an element of privateEndpointConnections List. */ @Immutable public final class PrivateEndpointConnectionVaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionVaultProperties.class); - /* * Format of id * subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. @@ -27,6 +23,25 @@ public final class PrivateEndpointConnectionVaultProperties { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnection properties; + /* + * The name of the private Endpoint Connection + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type, which will be of the format, + * Microsoft.RecoveryServices/vaults/privateEndpointConnections + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The location of the private Endpoint connection + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + /** * Get the id property: Format of id * subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. @@ -46,6 +61,34 @@ public PrivateEndpointConnection properties() { return this.properties; } + /** + * Get the name property: The name of the private Endpoint Connection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type, which will be of the format, + * Microsoft.RecoveryServices/vaults/privateEndpointConnections. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the private Endpoint connection. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Validates the instance. * diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java index e4648e45f6246..ad9cc61d66d02 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Class which represent the stamps associated with the vault. */ @Fluent public final class PrivateLinkResources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResources.class); - /* * A collection of private link resources */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java index 9f7d5040b29a6..0b063f7050b58 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java @@ -18,7 +18,8 @@ public interface PrivateLinkResourcesOperations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName); @@ -31,7 +32,8 @@ public interface PrivateLinkResourcesOperations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class which represent the stamps associated with the vault. + * @return class which represent the stamps associated with the vault as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName, Context context); @@ -58,7 +60,7 @@ public interface PrivateLinkResourcesOperations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information of the private link resource. + * @return information of the private link resource along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String vaultName, String privateLinkResourceName, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java index b02f57cf71b74..973fe54fa0f3f 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Gets or sets private link service connection state. */ @Immutable public final class PrivateLinkServiceConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); - /* * Gets or sets the status. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java index d8eb976c54527..388398c9d6e7e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java @@ -6,15 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Raw certificate data. */ @Fluent public final class RawCertificateData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RawCertificateData.class); - /* * Specifies the authentication type. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java index 07a35494af559..696d21d434cba 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java @@ -37,7 +37,7 @@ CheckNameAvailabilityResult checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for check name availability API. + * @return response for check name availability API along with {@link Response}. */ Response checkNameAvailabilityWithResponse( String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java index 26d4a56082311..c87b3f62c8f87 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java @@ -31,7 +31,7 @@ public interface RegisteredIdentities { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String vaultName, String identityName, Context context); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java index dfd22ab27dd46..0c3934401882b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Replication usages for vault. */ @Fluent public final class ReplicationUsageList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsageList.class); - /* * The list of replication usages for the given vault. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java index 02184a089e102..7de643f26cb6a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java @@ -17,7 +17,7 @@ public interface ReplicationUsages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName); @@ -30,7 +30,7 @@ public interface ReplicationUsages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return replication usages for vault. + * @return replication usages for vault as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String vaultName, Context context); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java index d86dc76d5bd87..90ff921ad5b04 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +16,6 @@ @JsonTypeName("AzureActiveDirectory") @Fluent public final class ResourceCertificateAndAadDetails extends ResourceCertificateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateAndAadDetails.class); - /* * AAD tenant authority. */ @@ -49,6 +46,12 @@ public final class ResourceCertificateAndAadDetails extends ResourceCertificateD @JsonProperty(value = "azureManagementEndpointAudience", required = true) private String azureManagementEndpointAudience; + /* + * Service Resource Id. + */ + @JsonProperty(value = "serviceResourceId") + private String serviceResourceId; + /** * Get the aadAuthority property: AAD tenant authority. * @@ -150,6 +153,26 @@ public ResourceCertificateAndAadDetails withAzureManagementEndpointAudience( return this; } + /** + * Get the serviceResourceId property: Service Resource Id. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Set the serviceResourceId property: Service Resource Id. + * + * @param serviceResourceId the serviceResourceId value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withServiceResourceId(String serviceResourceId) { + this.serviceResourceId = serviceResourceId; + return this; + } + /** {@inheritDoc} */ @Override public ResourceCertificateAndAadDetails withCertificate(byte[] certificate) { @@ -215,37 +238,39 @@ public ResourceCertificateAndAadDetails withValidTo(OffsetDateTime validTo) { public void validate() { super.validate(); if (aadAuthority() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property aadAuthority in model ResourceCertificateAndAadDetails")); } if (aadTenantId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property aadTenantId in model ResourceCertificateAndAadDetails")); } if (servicePrincipalClientId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property servicePrincipalClientId in model" + " ResourceCertificateAndAadDetails")); } if (servicePrincipalObjectId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property servicePrincipalObjectId in model" + " ResourceCertificateAndAadDetails")); } if (azureManagementEndpointAudience() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property azureManagementEndpointAudience in model" + " ResourceCertificateAndAadDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceCertificateAndAadDetails.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java index 6a48474d3d87f..410eb15f823e8 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +16,6 @@ @JsonTypeName("AccessControlService") @Fluent public final class ResourceCertificateAndAcsDetails extends ResourceCertificateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateAndAcsDetails.class); - /* * ACS namespace name - tenant for our service. */ @@ -162,22 +159,24 @@ public ResourceCertificateAndAcsDetails withValidTo(OffsetDateTime validTo) { public void validate() { super.validate(); if (globalAcsNamespace() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property globalAcsNamespace in model ResourceCertificateAndAcsDetails")); } if (globalAcsHostname() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property globalAcsHostname in model ResourceCertificateAndAcsDetails")); } if (globalAcsRPRealm() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property globalAcsRPRealm in model ResourceCertificateAndAcsDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceCertificateAndAcsDetails.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java index 27224c81bf094..ebd6cc91a4ca8 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -27,8 +25,6 @@ }) @Fluent public class ResourceCertificateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateDetails.class); - /* * The base64 encoded certificate raw data string. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java index 4b920cd436f8f..afa21bba313ed 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java @@ -16,6 +16,12 @@ public final class ResourceIdentityType extends ExpandableStringEnum { + /** Static value Unknown for ResourceMoveState. */ + public static final ResourceMoveState UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for ResourceMoveState. */ + public static final ResourceMoveState IN_PROGRESS = fromString("InProgress"); + + /** Static value PrepareFailed for ResourceMoveState. */ + public static final ResourceMoveState PREPARE_FAILED = fromString("PrepareFailed"); + + /** Static value CommitFailed for ResourceMoveState. */ + public static final ResourceMoveState COMMIT_FAILED = fromString("CommitFailed"); + + /** Static value PrepareTimedout for ResourceMoveState. */ + public static final ResourceMoveState PREPARE_TIMEDOUT = fromString("PrepareTimedout"); + + /** Static value CommitTimedout for ResourceMoveState. */ + public static final ResourceMoveState COMMIT_TIMEDOUT = fromString("CommitTimedout"); + + /** Static value MoveSucceeded for ResourceMoveState. */ + public static final ResourceMoveState MOVE_SUCCEEDED = fromString("MoveSucceeded"); + + /** Static value Failure for ResourceMoveState. */ + public static final ResourceMoveState FAILURE = fromString("Failure"); + + /** Static value CriticalFailure for ResourceMoveState. */ + public static final ResourceMoveState CRITICAL_FAILURE = fromString("CriticalFailure"); + + /** Static value PartialSuccess for ResourceMoveState. */ + public static final ResourceMoveState PARTIAL_SUCCESS = fromString("PartialSuccess"); + + /** + * Creates or finds a ResourceMoveState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceMoveState. + */ + @JsonCreator + public static ResourceMoveState fromString(String name) { + return fromString(name, ResourceMoveState.class); + } + + /** @return known ResourceMoveState values. */ + public static Collection values() { + return values(ResourceMoveState.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceProviders.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceProviders.java new file mode 100644 index 0000000000000..36a8eb52df465 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceProviders.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource. + */ + OperationResource getOperationStatus(String resourceGroupName, String vaultName, String operationId); + + /** + * Gets the operation status for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a resource along with {@link Response}. + */ + Response getOperationStatusWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource. + */ + Vault getOperationResult(String resourceGroupName, String vaultName, String operationId); + + /** + * Gets the operation result for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result for a resource along with {@link Response}. + */ + Response getOperationResultWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java index 0f1005b290fb0..34accf2872d7a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java @@ -6,20 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Identifies the unique system identifier for each Azure resource. */ @Fluent public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - /* * The Sku name. */ @JsonProperty(value = "name", required = true) private SkuName name; + /* + * The Sku tier. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The sku family + */ + @JsonProperty(value = "family") + private String family; + + /* + * The sku size + */ + @JsonProperty(value = "size") + private String size; + + /* + * The sku capacity + */ + @JsonProperty(value = "capacity") + private String capacity; + /** * Get the name property: The Sku name. * @@ -40,6 +61,86 @@ public Sku withName(SkuName name) { return this; } + /** + * Get the tier property: The Sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The Sku tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the family property: The sku family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The sku family. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size property: The sku size. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The sku size. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the capacity property: The sku capacity. + * + * @return the capacity value. + */ + public String capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The sku capacity. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(String capacity) { + this.capacity = capacity; + return this; + } + /** * Validates the instance. * @@ -47,8 +148,10 @@ public Sku withName(SkuName name) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java index 2b3f45a3da0d9..0d56a061da239 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Details for upgrading vault. */ @Immutable public final class UpgradeDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeDetails.class); - /* * ID of the vault upgrade operation. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java index 165dc314f90c3..9b2db898c3e9c 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java @@ -17,7 +17,7 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ PagedIterable listByVaults(String resourceGroupName, String vaultName); @@ -30,7 +30,7 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usage for vault. + * @return usage for vault as paginated response with {@link PagedIterable}. */ PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UserIdentity.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UserIdentity.java new file mode 100644 index 0000000000000..c16ea8e71a6ed --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UserIdentity.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A resource identity that is managed by the user of the service. */ +@Immutable +public class UserIdentity { + /* + * The principal ID of the user-assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client ID of the user-assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal ID of the user-assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the user-assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java index 2f0622fb30955..4aa9fe1a96081 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; import java.util.Map; @@ -67,6 +68,13 @@ public interface Vault { */ Sku sku(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the region of the resource. * diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java index a4ea1b0bbea7c..4847915d290bd 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java @@ -29,6 +29,13 @@ public interface VaultExtendedInfoResource { */ String type(); + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + /** * Gets the integrityKey property: Integrity key. * @@ -57,13 +64,6 @@ public interface VaultExtendedInfoResource { */ String algorithm(); - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - /** * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner object. * diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java index e948bf3f92fef..de0d8957d6d30 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java @@ -31,7 +31,7 @@ public interface VaultExtendedInfoes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the vault extended info. + * @return the vault extended info along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String vaultName, Context context); @@ -59,7 +59,7 @@ VaultExtendedInfoResource createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ Response createOrUpdateWithResponse( String resourceGroupName, @@ -91,7 +91,7 @@ VaultExtendedInfoResource update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return vault extended information. + * @return vault extended information along with {@link Response}. */ Response updateWithResponse( String resourceGroupName, diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java index 6767721ed2381..d45d6b463de4b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response model for a list of Vaults. */ @Fluent public final class VaultList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultList.class); - /* * The value property. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java index a094519381c24..e3ba6f0949e2b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Properties of the vault. */ @Fluent public final class VaultProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultProperties.class); - /* * Provisioning State. */ @@ -45,6 +41,30 @@ public final class VaultProperties { @JsonProperty(value = "privateEndpointStateForSiteRecovery", access = JsonProperty.Access.WRITE_ONLY) private VaultPrivateEndpointState privateEndpointStateForSiteRecovery; + /* + * Customer Managed Key details of the resource. + */ + @JsonProperty(value = "encryption") + private VaultPropertiesEncryption encryption; + + /* + * The details of the latest move operation performed on the Azure Resource + */ + @JsonProperty(value = "moveDetails") + private VaultPropertiesMoveDetails moveDetails; + + /* + * The State of the Resource after the move operation + */ + @JsonProperty(value = "moveState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceMoveState moveState; + + /* + * Backup storage version + */ + @JsonProperty(value = "backupStorageVersion", access = JsonProperty.Access.WRITE_ONLY) + private BackupStorageVersion backupStorageVersion; + /** * Get the provisioningState property: Provisioning State. * @@ -101,6 +121,64 @@ public VaultPrivateEndpointState privateEndpointStateForSiteRecovery() { return this.privateEndpointStateForSiteRecovery; } + /** + * Get the encryption property: Customer Managed Key details of the resource. + * + * @return the encryption value. + */ + public VaultPropertiesEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Customer Managed Key details of the resource. + * + * @param encryption the encryption value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withEncryption(VaultPropertiesEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the moveDetails property: The details of the latest move operation performed on the Azure Resource. + * + * @return the moveDetails value. + */ + public VaultPropertiesMoveDetails moveDetails() { + return this.moveDetails; + } + + /** + * Set the moveDetails property: The details of the latest move operation performed on the Azure Resource. + * + * @param moveDetails the moveDetails value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withMoveDetails(VaultPropertiesMoveDetails moveDetails) { + this.moveDetails = moveDetails; + return this; + } + + /** + * Get the moveState property: The State of the Resource after the move operation. + * + * @return the moveState value. + */ + public ResourceMoveState moveState() { + return this.moveState; + } + + /** + * Get the backupStorageVersion property: Backup storage version. + * + * @return the backupStorageVersion value. + */ + public BackupStorageVersion backupStorageVersion() { + return this.backupStorageVersion; + } + /** * Validates the instance. * @@ -113,5 +191,11 @@ public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } + if (encryption() != null) { + encryption().validate(); + } + if (moveDetails() != null) { + moveDetails().validate(); + } } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesEncryption.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesEncryption.java new file mode 100644 index 0000000000000..74a5295a71380 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesEncryption.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer Managed Key details of the resource. */ +@Fluent +public final class VaultPropertiesEncryption { + /* + * The properties of the Key Vault which hosts CMK + */ + @JsonProperty(value = "keyVaultProperties") + private CmkKeyVaultProperties keyVaultProperties; + + /* + * The details of the identity used for CMK + */ + @JsonProperty(value = "kekIdentity") + private CmkKekIdentity kekIdentity; + + /* + * Enabling/Disabling the Double Encryption state + */ + @JsonProperty(value = "infrastructureEncryption") + private InfrastructureEncryptionState infrastructureEncryption; + + /** + * Get the keyVaultProperties property: The properties of the Key Vault which hosts CMK. + * + * @return the keyVaultProperties value. + */ + public CmkKeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The properties of the Key Vault which hosts CMK. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the VaultPropertiesEncryption object itself. + */ + public VaultPropertiesEncryption withKeyVaultProperties(CmkKeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the kekIdentity property: The details of the identity used for CMK. + * + * @return the kekIdentity value. + */ + public CmkKekIdentity kekIdentity() { + return this.kekIdentity; + } + + /** + * Set the kekIdentity property: The details of the identity used for CMK. + * + * @param kekIdentity the kekIdentity value to set. + * @return the VaultPropertiesEncryption object itself. + */ + public VaultPropertiesEncryption withKekIdentity(CmkKekIdentity kekIdentity) { + this.kekIdentity = kekIdentity; + return this; + } + + /** + * Get the infrastructureEncryption property: Enabling/Disabling the Double Encryption state. + * + * @return the infrastructureEncryption value. + */ + public InfrastructureEncryptionState infrastructureEncryption() { + return this.infrastructureEncryption; + } + + /** + * Set the infrastructureEncryption property: Enabling/Disabling the Double Encryption state. + * + * @param infrastructureEncryption the infrastructureEncryption value to set. + * @return the VaultPropertiesEncryption object itself. + */ + public VaultPropertiesEncryption withInfrastructureEncryption( + InfrastructureEncryptionState infrastructureEncryption) { + this.infrastructureEncryption = infrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (kekIdentity() != null) { + kekIdentity().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesMoveDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesMoveDetails.java new file mode 100644 index 0000000000000..8c6adcf1c9b2f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesMoveDetails.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The details of the latest move operation performed on the Azure Resource. */ +@Immutable +public final class VaultPropertiesMoveDetails { + /* + * OperationId of the Resource Move Operation + */ + @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) + private String operationId; + + /* + * Start Time of the Resource Move Operation + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTimeUtc; + + /* + * End Time of the Resource Move Operation + */ + @JsonProperty(value = "completionTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime completionTimeUtc; + + /* + * Source Resource of the Resource Move Operation + */ + @JsonProperty(value = "sourceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceResourceId; + + /* + * Target Resource of the Resource Move Operation + */ + @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceId; + + /** + * Get the operationId property: OperationId of the Resource Move Operation. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Get the startTimeUtc property: Start Time of the Resource Move Operation. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the completionTimeUtc property: End Time of the Resource Move Operation. + * + * @return the completionTimeUtc value. + */ + public OffsetDateTime completionTimeUtc() { + return this.completionTimeUtc; + } + + /** + * Get the sourceResourceId property: Source Resource of the Resource Move Operation. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Get the targetResourceId property: Target Resource of the Resource Move Operation. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java index 0ae89c92a2625..a88b0a2504a5e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Usage for vault. */ @Fluent public final class VaultUsageList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultUsageList.class); - /* * The list of usages for the given vault. */ diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java index 27b79c8dae0cf..7367701726511 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java @@ -15,7 +15,7 @@ public interface Vaults { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response model for a list of Vaults. + * @return the response model for a list of Vaults as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -74,7 +74,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); @@ -98,7 +98,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); @@ -109,7 +109,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response}. */ Vault getById(String id); @@ -121,7 +121,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Vault details. + * @return the Vault details along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -143,7 +143,7 @@ public interface Vaults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..9f54bdbf59673 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOperations(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationGetSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationGetSamples.java new file mode 100644 index 0000000000000..0aeb07b8c7fc0 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation Get. */ +public final class PrivateLinkResourcesOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetPrivateLinkResources.json + */ + /** + * Sample code: Get PrivateLinkResource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getPrivateLinkResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .privateLinkResourcesOperations() + .getWithResponse("petesting", "pemsi-ecy-rsv2", "backupResource", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationListSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationListSamples.java new file mode 100644 index 0000000000000..f2e53a1ce86d2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation List. */ +public final class PrivateLinkResourcesOperationListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListPrivateLinkResources.json + */ + /** + * Sample code: List PrivateLinkResources. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listPrivateLinkResources( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.privateLinkResourcesOperations().list("petesting", "pemsi-ecy-rsv2", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilitySamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..05ae07dd17149 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilitySamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; + +/** Samples for RecoveryServices CheckNameAvailability. */ +public final class RecoveryServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/CheckNameAvailability_Available.json + */ + /** + * Sample code: Availability status of Resource Name when no resource with same name, type and subscription exists, + * nor has been deleted within last 24 hours. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void + availabilityStatusOfResourceNameWhenNoResourceWithSameNameTypeAndSubscriptionExistsNorHasBeenDeletedWithinLast24Hours( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .recoveryServices() + .checkNameAvailabilityWithResponse( + "resGroupFoo", + "westus", + new CheckNameAvailabilityParameters() + .withType("Microsoft.RecoveryServices/Vaults") + .withName("swaggerExample"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/CheckNameAvailability_NotAvailable.json + */ + /** + * Sample code: Availability status of Resource Name when resource with same name, type and subscription exists. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void availabilityStatusOfResourceNameWhenResourceWithSameNameTypeAndSubscriptionExists( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .recoveryServices() + .checkNameAvailabilityWithResponse( + "resGroupBar", + "westus", + new CheckNameAvailabilityParameters() + .withType("Microsoft.RecoveryServices/Vaults") + .withName("swaggerExample2"), + Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteSamples.java new file mode 100644 index 0000000000000..4ce0f74040a6f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for RegisteredIdentities Delete. */ +public final class RegisteredIdentitiesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/DeleteRegisteredIdentities.json + */ + /** + * Sample code: Delete registered Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void deleteRegisteredIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.registeredIdentities().deleteWithResponse("BCDRIbzRG", "BCDRIbzVault", "dpmcontainer01", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListSamples.java new file mode 100644 index 0000000000000..9e305212b8c00 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationUsages List. */ +public final class ReplicationUsagesListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListReplicationUsages.json + */ + /** + * Sample code: Gets Replication usages of vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getsReplicationUsagesOfVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.replicationUsages().list("avrai7517RG1", "avrai7517Vault1", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationResultSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationResultSamples.java new file mode 100644 index 0000000000000..2e784e7d9b70e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationResultSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationResult. */ +public final class ResourceProviderGetOperationResultSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetOperationResult.json + */ + /** + * Sample code: Get Operation Result. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getOperationResult(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .resourceProviders() + .getOperationResultWithResponse( + "HelloWorld", + "swaggerExample", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationStatusSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationStatusSamples.java new file mode 100644 index 0000000000000..8b4ac90efc48a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProviderGetOperationStatusSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetOperationStatus. */ +public final class ResourceProviderGetOperationStatusSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GetOperationStatus.json + */ + /** + * Sample code: Get Operation Status. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .resourceProviders() + .getOperationStatusWithResponse( + "HelloWorld", + "swaggerExample", + "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", + Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsSamples.java new file mode 100644 index 0000000000000..9258c4a81a280 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Usages ListByVaults. */ +public final class UsagesListByVaultsSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListUsages.json + */ + /** + * Sample code: Gets vault usages. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getsVaultUsages(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.usages().listByVaults("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateSamples.java new file mode 100644 index 0000000000000..dcbffd8d1f2e7 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.resourcemanager.recoveryservices.models.AuthType; +import com.azure.resourcemanager.recoveryservices.models.RawCertificateData; + +/** Samples for VaultCertificates Create. */ +public final class VaultCertificatesCreateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVaultCred.json + */ + /** + * Sample code: Download vault credential file. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void downloadVaultCredentialFile( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultCertificates() + .define("BCDRIbzVault77777777-d41f-4550-9f70-7708a3a2283b-12-18-2017-vaultcredentials") + .withExistingVault("BCDRIbzRG", "BCDRIbzVault") + .withProperties( + new RawCertificateData() + .withAuthType(AuthType.AAD) + .withCertificate( + "MTTC3TCCAcWgAwIBAgIQEj9h+ZLlXK9KrqZX9UkAnzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE3MTIxODA5MTc1M1oXDTE3MTIyMzA5Mjc1M1owHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK773/eZZ69RbZZAT05r9MjUxu9y1L1Pn1EgPk62IPJyHlO3OZA922eSBahhP4bgmFljN4LVReqQ5eT/wqO0Zhc+yFkUy4U4RdbQLeUZt2W7yy9XLXgVvqeYDgsjg/QhHetgHArQBW+tlQq5+zPdU7zchI4rbShSJrWhLrZFWiOyFPsuAE4joUQHNlRifdCTsBGKk8HRCY3j1S3c4bfEn3zxlrvrXXssRuW5mJM95rMk0tskoRxXSCi6i9bnlki2Cs9mpVMmBFeofs41KwzlWU0TgpdD8s1QEdvfGB5NbByfetPX7MfJaTBeHZEGbv/Iq8l72u8sPBoOhcaH7qDE/mECAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAILfgHluye1Q+WelhgWhpBBdIq2C0btfV8eFsZaTlBUrM0fwpxQSlAWc2oYHVMQI4A5iUjbDOY35O4yc+TnWKDBKf+laqDP+yos4aiUPuadGUZfvDk7kuw7xeECs64JpHAIEKdRHFW9rD3gwG+nIWaDnEL/7rTyhL3kXrRW2MSUAL8g3GX8Z45c+MQY0jmASIqWdhGn1vpAGyA9mKkzsqg7FXjg8GZb24tGl5Ky85+ip4dkBfXinDD8WwaGyjhGGK97ErvNmN36qly/H0H1Qngiovg1FbHDmkcFO5QclnEJsFFmcO2CcHp5Fqh2wXn5O1cQaxCIRTpQ/uXRpDjl2wKs=" + .getBytes())) + .create(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoCreateOrUpdateSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b6e4c9000b459 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo CreateOrUpdate. */ +public final class VaultExtendedInfoCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/UpdateVaultExtendedInfo.json + */ + /** + * Sample code: Put ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void putExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .createOrUpdateWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", null, Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoGetSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoGetSamples.java new file mode 100644 index 0000000000000..6aa1c4c9711e3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo Get. */ +public final class VaultExtendedInfoGetSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GETVaultExtendedInfo.json + */ + /** + * Sample code: Get ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .getWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoUpdateSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoUpdateSamples.java new file mode 100644 index 0000000000000..dc4bbaf3f7e6f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultExtendedInfoUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VaultExtendedInfo Update. */ +public final class VaultExtendedInfoUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/UpdateVaultExtendedInfo.json + */ + /** + * Sample code: PATCH ExtendedInfo of Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void pATCHExtendedInfoOfResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaultExtendedInfoes() + .updateWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", null, Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsCreateOrUpdateSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b58f53701b0bb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsCreateOrUpdateSamples.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity; +import com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties; +import com.azure.resourcemanager.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState; +import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType; +import com.azure.resourcemanager.recoveryservices.models.Sku; +import com.azure.resourcemanager.recoveryservices.models.SkuName; +import com.azure.resourcemanager.recoveryservices.models.UserIdentity; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vaults CreateOrUpdate. */ +public final class VaultsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault_WithCMK.json + */ + /** + * Sample code: Create or Update Vault with CustomerManagedKeys. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateVaultWithCustomerManagedKeys( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")) + .withKekIdentity( + new CmkKekIdentity() + .withUserAssignedIdentity( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")) + .withInfrastructureEncryption(InfrastructureEncryptionState.ENABLED))) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault.json + */ + /** + * Sample code: Create or Update Recovery Services vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateRecoveryServicesVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new VaultProperties()) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PUTVault_WithUserAssignedIdentity.json + */ + /** + * Sample code: Create or Update Vault with User Assigned Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void createOrUpdateVaultWithUserAssignedIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .define("swaggerExample") + .withRegion("West US") + .withExistingResourceGroup("Default-RecoveryServices-ResourceGroup") + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .withProperties(new VaultProperties()) + .withSku(new Sku().withName(SkuName.STANDARD)) + .create(); + } + + @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/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsDeleteSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsDeleteSamples.java new file mode 100644 index 0000000000000..24db390c012a9 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults Delete. */ +public final class VaultsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/DeleteVault.json + */ + /** + * Sample code: Delete Recovery Services Vault. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void deleteRecoveryServicesVault( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().deleteWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsGetByResourceGroupSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c3e00636be83d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults GetByResourceGroup. */ +public final class VaultsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/GETVault.json + */ + /** + * Sample code: Get Recovery Services Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void getRecoveryServicesResource( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager + .vaults() + .getByResourceGroupWithResponse("Default-RecoveryServices-ResourceGroup", "swaggerExample", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListByResourceGroupSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..47ecf93209de1 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults ListByResourceGroup. */ +public final class VaultsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListResources.json + */ + /** + * Sample code: List of Recovery Services Resources in ResourceGroup. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOfRecoveryServicesResourcesInResourceGroup( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().listByResourceGroup("Default-RecoveryServices-ResourceGroup", Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListSamples.java new file mode 100644 index 0000000000000..824131021ec72 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults List. */ +public final class VaultsListSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListBySubscriptionIds.json + */ + /** + * Sample code: List of Recovery Services Resources in SubscriptionId. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void listOfRecoveryServicesResourcesInSubscriptionId( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + manager.vaults().list(Context.NONE); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsUpdateSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsUpdateSamples.java new file mode 100644 index 0000000000000..0b87863178746 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/VaultsUpdateSamples.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity; +import com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties; +import com.azure.resourcemanager.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState; +import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType; +import com.azure.resourcemanager.recoveryservices.models.UserIdentity; +import com.azure.resourcemanager.recoveryservices.models.Vault; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vaults Update. */ +public final class VaultsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithCMK.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")) + .withKekIdentity( + new CmkKekIdentity() + .withUserAssignedIdentity( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")) + .withInfrastructureEncryption(InfrastructureEncryptionState.ENABLED))) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PatchVault_WithCMK2.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys2. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys2( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKekIdentity(new CmkKekIdentity().withUseSystemAssignedIdentity(true)))) + .withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithCMK3.json + */ + /** + * Sample code: Update Resource With CustomerManagedKeys3. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithCustomerManagedKeys3( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withProperties( + new VaultProperties() + .withEncryption( + new VaultPropertiesEncryption() + .withKeyVaultProperties( + new CmkKeyVaultProperties() + .withKeyUri( + "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3")))) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault.json + */ + /** + * Sample code: Update Resource. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResource(com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource.update().withTags(mapOf("PatchKey", "PatchKeyUpdated")).apply(); + } + + /* + * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PATCHVault_WithUserAssignedIdentity.json + */ + /** + * Sample code: Update Resource With User Assigned Identity. + * + * @param manager Entry point to RecoveryServicesManager. + */ + public static void updateResourceWithUserAssignedIdentity( + com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) { + Vault resource = + manager.vaults().getByResourceGroupWithResponse("HelloWorld", "swaggerExample", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("PatchKey", "PatchKeyUpdated")) + .withIdentity( + new IdentityData() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi", + new UserIdentity()))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}