diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b84be386aa817..7f10b80a26dac 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -299,7 +299,7 @@ com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0;1.1.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.5;1.0.0-beta.6 com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0-beta.7;1.0.0-beta.8 -com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.3.0;1.4.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.3.0;1.4.0 com.azure.resourcemanager:azure-resourcemanager-kusto;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.1.0;1.2.0-beta.8 diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md index 0733b9b8dd19d..b1e613033a999 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md @@ -1,14 +1,35 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.4.0 (2024-12-19) -### Features Added +- Azure Resource Manager RecoveryServices client library for Java. This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### Serialization/Deserialization change + +- `Jackson` is removed from dependency and no longer supported. + +##### Migration Guide + +If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility: +```java +objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule()); +``` + +### Features Added + +#### `models.PatchTrackedResource` was modified + +* `type()` was added +* `name()` was added +* `id()` was added -### Other Changes +#### `models.PatchVault` was modified + +* `type()` was added +* `name()` was added +* `id()` was added ## 1.3.0 (2024-05-20) diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md index b8768b2342ed3..7bfecd17d96ee 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-recoveryservices - 1.3.0 + 1.4.0 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -82,15 +78,11 @@ vault = recoveryServicesManager.vaults() .withSku(new Sku().withName(SkuName.RS0).withTier("Standard")) .withProperties(new VaultProperties() .withSecuritySettings(new SecuritySettings() - .withImmutabilitySettings( - new ImmutabilitySettings() - .withState(ImmutabilityState.UNLOCKED))) + .withImmutabilitySettings(new ImmutabilitySettings().withState(ImmutabilityState.UNLOCKED))) .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) .withRestoreSettings(new RestoreSettings() - .withCrossSubscriptionRestoreSettings( - new CrossSubscriptionRestoreSettings() - .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.ENABLED))) - ) + .withCrossSubscriptionRestoreSettings(new CrossSubscriptionRestoreSettings() + .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.ENABLED)))) .create(); ``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md) @@ -116,6 +108,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md index 9892ac7609328..cc9734b991036 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md @@ -58,7 +58,9 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListOperations.json */ /** * Sample code: ListOperations. @@ -79,7 +81,9 @@ public final class OperationsListSamples { */ public final class PrivateLinkResourcesOperationGetSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetPrivateLinkResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetPrivateLinkResources.json */ /** * Sample code: Get PrivateLinkResource. @@ -102,7 +106,9 @@ public final class PrivateLinkResourcesOperationGetSamples { */ public final class PrivateLinkResourcesOperationListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListPrivateLinkResources.json */ /** * Sample code: List PrivateLinkResources. @@ -130,7 +136,9 @@ import java.util.Arrays; */ public final class RecoveryServicesCapabilitiesSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Capabilities.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * Capabilities.json */ /** * Sample code: Capabilities for Microsoft.RecoveryServices/Vaults. @@ -160,7 +168,9 @@ import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityPa */ public final class RecoveryServicesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_Available.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * CheckNameAvailability_Available.json */ /** * Sample code: Availability status of Resource Name when no resource with same name, type and subscription exists, @@ -179,7 +189,9 @@ public final class RecoveryServicesCheckNameAvailabilitySamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_NotAvailable.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * CheckNameAvailability_NotAvailable.json */ /** * Sample code: Availability status of Resource Name when resource with same name, type and subscription exists. @@ -205,7 +217,9 @@ public final class RecoveryServicesCheckNameAvailabilitySamples { */ public final class RegisteredIdentitiesDeleteSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteRegisteredIdentities.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * DeleteRegisteredIdentities.json */ /** * Sample code: Delete registered Identity. @@ -228,7 +242,9 @@ public final class RegisteredIdentitiesDeleteSamples { */ public final class ReplicationUsagesListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListReplicationUsages.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListReplicationUsages.json */ /** * Sample code: Gets Replication usages of vault. @@ -250,7 +266,9 @@ public final class ReplicationUsagesListSamples { */ public final class ResourceProviderGetOperationResultSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationResult.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetOperationResult.json */ /** * Sample code: Get Operation Result. @@ -274,7 +292,9 @@ public final class ResourceProviderGetOperationResultSamples { */ public final class ResourceProviderGetOperationStatusSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationStatus.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetOperationStatus.json */ /** * Sample code: Get Operation Status. @@ -298,7 +318,9 @@ public final class ResourceProviderGetOperationStatusSamples { */ public final class UsagesListByVaultsSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListUsages.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListUsages. + * json */ /** * Sample code: Gets vault usages. @@ -323,7 +345,9 @@ import com.azure.resourcemanager.recoveryservices.models.RawCertificateData; */ public final class VaultCertificatesCreateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVaultCred.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVaultCred.json */ /** * Sample code: Download vault credential file. @@ -353,7 +377,9 @@ public final class VaultCertificatesCreateSamples { */ public final class VaultExtendedInfoCreateOrUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/UpdateVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * UpdateVaultExtendedInfo.json */ /** * Sample code: Put ExtendedInfo of Resource. @@ -377,7 +403,9 @@ public final class VaultExtendedInfoCreateOrUpdateSamples { */ public final class VaultExtendedInfoGetSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GETVaultExtendedInfo.json */ /** * Sample code: Get ExtendedInfo of Resource. @@ -402,7 +430,9 @@ public final class VaultExtendedInfoGetSamples { */ public final class VaultExtendedInfoUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/UpdateVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * UpdateVaultExtendedInfo.json */ /** * Sample code: PATCH ExtendedInfo of Resource. @@ -448,7 +478,9 @@ import java.util.Map; */ public final class VaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithCMK.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithCMK.json */ /** * Sample code: Create or Update Vault with CustomerManagedKeys. @@ -476,7 +508,9 @@ public final class VaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault. + * json */ /** * Sample code: Create or Update Recovery Services vault. @@ -496,7 +530,9 @@ public final class VaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_ResourceGuardEnabled.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_ResourceGuardEnabled.json */ /** * Sample code: Create or Update Vault performing critical operation With MUA. @@ -526,7 +562,9 @@ public final class VaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithUserAssignedIdentity.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithUserAssignedIdentity.json */ /** * Sample code: Create or Update Vault with User Assigned Identity. @@ -549,7 +587,9 @@ public final class VaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithMonitoringSettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithMonitoringSettings.json */ /** * Sample code: Create or Update Vault With Monitoring Setting. @@ -577,7 +617,9 @@ public final class VaultsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithRedundancySettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithRedundancySettings.json */ /** * Sample code: Create or Update Vault With Redundancy Setting. @@ -621,7 +663,9 @@ public final class VaultsCreateOrUpdateSamples { */ public final class VaultsDeleteSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteVault + * .json */ /** * Sample code: Delete Recovery Services Vault. @@ -644,7 +688,9 @@ public final class VaultsDeleteSamples { */ public final class VaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVault. + * json */ /** * Sample code: Get Recovery Services Resource. @@ -668,7 +714,9 @@ public final class VaultsGetByResourceGroupSamples { */ public final class VaultsListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListBySubscriptionIds.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListBySubscriptionIds.json */ /** * Sample code: List of Recovery Services Resources in SubscriptionId. @@ -690,7 +738,9 @@ public final class VaultsListSamples { */ public final class VaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListResources.json */ /** * Sample code: List of Recovery Services Resources in ResourceGroup. @@ -732,7 +782,9 @@ import java.util.Map; */ public final class VaultsUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithMonitoringSettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithMonitoringSettings.json */ /** * Sample code: Update Vault With Monitoring Setting. @@ -758,7 +810,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithCMK.json */ /** * Sample code: Update Resource With CustomerManagedKeys. @@ -785,7 +839,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PatchVault_WithCMK2.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PatchVault_WithCMK2.json */ /** * Sample code: Update Resource With CustomerManagedKeys2. @@ -806,7 +862,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK3.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithCMK3.json */ /** * Sample code: Update Resource With CustomerManagedKeys3. @@ -830,7 +888,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault. + * json */ /** * Sample code: Update Resource. @@ -845,7 +905,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithRedundancySettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithRedundancySettings.json */ /** * Sample code: Update Vault With Redundancy Setting. @@ -865,7 +927,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithUserAssignedIdentity.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithUserAssignedIdentity.json */ /** * Sample code: Update Resource With User Assigned Identity. diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml index 0ba9b1426a65f..3706a0b61ed0d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-recoveryservices - 1.4.0-beta.1 + 1.4.0 jar Microsoft Azure SDK for RecoveryServices Management @@ -45,7 +45,7 @@ UTF-8 0 0 - true + false 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 d0f8ed23c449b..13747fcd49f94 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 @@ -11,15 +11,15 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; +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; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -241,7 +241,7 @@ public RecoveryServicesManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.recoveryservices") .append("/") - .append("1.3.0"); + .append("1.4.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -274,7 +274,7 @@ public RecoveryServicesManager authenticate(TokenCredential credential, AzurePro HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CapabilitiesResponseInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CapabilitiesResponseInner.java index 96b3f37e247c3..90449e08a7e22 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CapabilitiesResponseInner.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CapabilitiesResponseInner.java @@ -5,9 +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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.CapabilitiesResponseProperties; import com.azure.resourcemanager.recoveryservices.models.ResourceCapabilitiesBase; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Capabilities response for Microsoft.RecoveryServices. @@ -17,7 +21,6 @@ public final class CapabilitiesResponseInner extends ResourceCapabilitiesBase { /* * Capabilities properties in response */ - @JsonProperty(value = "properties") private CapabilitiesResponseProperties properties; /** @@ -62,9 +65,54 @@ public CapabilitiesResponseInner withType(String type) { */ @Override public void validate() { - super.validate(); if (properties() != null) { properties().validate(); } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model CapabilitiesResponseInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CapabilitiesResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CapabilitiesResponseInner. + */ + public static CapabilitiesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesResponseInner deserializedCapabilitiesResponseInner = new CapabilitiesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCapabilitiesResponseInner.withType(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedCapabilitiesResponseInner.properties = CapabilitiesResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesResponseInner; + }); } } 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 622765be04976..6162e56217215 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,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Response for check name availability API. Resource provider will set availability as true | false. */ @Fluent -public final class CheckNameAvailabilityResultInner { +public final class CheckNameAvailabilityResultInner implements JsonSerializable { /* * The nameAvailable property. */ - @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; /* * The reason property. */ - @JsonProperty(value = "reason") private String reason; /* * The message property. */ - @JsonProperty(value = "message") private String message; /** @@ -103,4 +104,48 @@ public CheckNameAvailabilityResultInner withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResultInner. + */ + public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner + = new CheckNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResultInner; + }); + } } 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 9faca24b12ba8..383acecd37e2f 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,37 +5,38 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay; import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Available operation details. */ @Fluent -public final class ClientDiscoveryValueForSingleApiInner { +public final class ClientDiscoveryValueForSingleApiInner + implements JsonSerializable { /* * Name of the Operation. */ - @JsonProperty(value = "name") private String name; /* * Contains the localized display information for this particular operation */ - @JsonProperty(value = "display") private ClientDiscoveryDisplay display; /* * The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX */ - @JsonProperty(value = "origin") private String origin; /* * ShoeBox properties for the given operation. */ - @JsonProperty(value = "properties") private ClientDiscoveryForProperties properties; /** @@ -139,4 +140,51 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryValueForSingleApiInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryValueForSingleApiInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryValueForSingleApiInner. + */ + public static ClientDiscoveryValueForSingleApiInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryValueForSingleApiInner deserializedClientDiscoveryValueForSingleApiInner + = new ClientDiscoveryValueForSingleApiInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClientDiscoveryValueForSingleApiInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedClientDiscoveryValueForSingleApiInner.display = ClientDiscoveryDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedClientDiscoveryValueForSingleApiInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClientDiscoveryValueForSingleApiInner.properties + = ClientDiscoveryForProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryValueForSingleApiInner; + }); + } } 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 index 18b71f24462e8..ef1d9f53ce904 100644 --- 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 @@ -6,48 +6,49 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Operation Resource. */ @Fluent -public final class OperationResourceInner { +public final class OperationResourceInner implements JsonSerializable { /* * 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. + * 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; /** @@ -187,4 +188,59 @@ public OperationResourceInner withStartTime(OffsetDateTime startTime) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationResourceInner. + */ + public static OperationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationResourceInner deserializedOperationResourceInner = new OperationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedOperationResourceInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedOperationResourceInner.error = ManagementError.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedOperationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationResourceInner.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedOperationResourceInner.status = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedOperationResourceInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationResourceInner; + }); + } } 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 c6fa839b65674..d3b0b09b7bd06 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 @@ -5,36 +5,36 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Information of the private link resource. */ @Immutable -public final class PrivateLinkResourceInner { +public final class PrivateLinkResourceInner implements JsonSerializable { /* * Resource properties */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; /* * Fully qualified identifier of the resource. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Name of the resource. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * e.g. Microsoft.RecoveryServices/vaults/privateLinkResources */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /** @@ -117,4 +117,47 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } } 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 index 89c88b72f8374..a208e2c8e8ecb 100644 --- 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 @@ -5,30 +5,31 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Properties of the private link resource. */ @Immutable -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * 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; /** @@ -72,4 +73,46 @@ public List requiredZoneNames() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/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 58bcad4d6ad05..cef54ba18e788 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,49 +5,47 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.JobsSummary; import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Replication usages of a vault. */ @Fluent -public final class ReplicationUsageInner { +public final class ReplicationUsageInner implements JsonSerializable { /* * Summary of the replication monitoring data for this vault. */ - @JsonProperty(value = "monitoringSummary") private MonitoringSummary monitoringSummary; /* * Summary of the replication jobs data for this vault. */ - @JsonProperty(value = "jobsSummary") private JobsSummary jobsSummary; /* * Number of replication protected items for this vault. */ - @JsonProperty(value = "protectedItemCount") private Integer protectedItemCount; /* * Number of replication recovery plans for this vault. */ - @JsonProperty(value = "recoveryPlanCount") private Integer recoveryPlanCount; /* * Number of servers registered to this vault. */ - @JsonProperty(value = "registeredServersCount") private Integer registeredServersCount; /* * The authentication type of recovery service providers in the vault. */ - @JsonProperty(value = "recoveryServicesProviderAuthType") private Integer recoveryServicesProviderAuthType; /** @@ -191,4 +189,56 @@ public void validate() { jobsSummary().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("monitoringSummary", this.monitoringSummary); + jsonWriter.writeJsonField("jobsSummary", this.jobsSummary); + jsonWriter.writeNumberField("protectedItemCount", this.protectedItemCount); + jsonWriter.writeNumberField("recoveryPlanCount", this.recoveryPlanCount); + jsonWriter.writeNumberField("registeredServersCount", this.registeredServersCount); + jsonWriter.writeNumberField("recoveryServicesProviderAuthType", this.recoveryServicesProviderAuthType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationUsageInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationUsageInner. + */ + public static ReplicationUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationUsageInner deserializedReplicationUsageInner = new ReplicationUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monitoringSummary".equals(fieldName)) { + deserializedReplicationUsageInner.monitoringSummary = MonitoringSummary.fromJson(reader); + } else if ("jobsSummary".equals(fieldName)) { + deserializedReplicationUsageInner.jobsSummary = JobsSummary.fromJson(reader); + } else if ("protectedItemCount".equals(fieldName)) { + deserializedReplicationUsageInner.protectedItemCount = reader.getNullable(JsonReader::getInt); + } else if ("recoveryPlanCount".equals(fieldName)) { + deserializedReplicationUsageInner.recoveryPlanCount = reader.getNullable(JsonReader::getInt); + } else if ("registeredServersCount".equals(fieldName)) { + deserializedReplicationUsageInner.registeredServersCount = reader.getNullable(JsonReader::getInt); + } else if ("recoveryServicesProviderAuthType".equals(fieldName)) { + deserializedReplicationUsageInner.recoveryServicesProviderAuthType + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationUsageInner; + }); + } } 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 ba63048521e53..de85a67337603 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,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.ResourceCertificateDetails; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Certificate corresponding to a vault that can be used by clients to register themselves with the vault. @@ -17,9 +20,23 @@ public final class VaultCertificateResponseInner extends ProxyResource { /* * Certificate details representing the Vault credentials. */ - @JsonProperty(value = "properties") private ResourceCertificateDetails properties; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of VaultCertificateResponseInner class. */ @@ -46,6 +63,36 @@ public VaultCertificateResponseInner withProperties(ResourceCertificateDetails p return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Validates the instance. * @@ -56,4 +103,48 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCertificateResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCertificateResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VaultCertificateResponseInner. + */ + public static VaultCertificateResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCertificateResponseInner deserializedVaultCertificateResponseInner + = new VaultCertificateResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVaultCertificateResponseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVaultCertificateResponseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVaultCertificateResponseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVaultCertificateResponseInner.properties = ResourceCertificateDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCertificateResponseInner; + }); + } } 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 index 237f3c92e4473..2ccaca20406cf 100644 --- 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 @@ -5,35 +5,35 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Vault extended information. */ @Fluent -public final class VaultExtendedInfo { +public final class VaultExtendedInfo implements JsonSerializable { /* * 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; /** @@ -129,4 +129,49 @@ public VaultExtendedInfo withAlgorithm(String algorithm) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("integrityKey", this.integrityKey); + jsonWriter.writeStringField("encryptionKey", this.encryptionKey); + jsonWriter.writeStringField("encryptionKeyThumbprint", this.encryptionKeyThumbprint); + jsonWriter.writeStringField("algorithm", this.algorithm); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultExtendedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultExtendedInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultExtendedInfo. + */ + public static VaultExtendedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultExtendedInfo deserializedVaultExtendedInfo = new VaultExtendedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("integrityKey".equals(fieldName)) { + deserializedVaultExtendedInfo.integrityKey = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + deserializedVaultExtendedInfo.encryptionKey = reader.getString(); + } else if ("encryptionKeyThumbprint".equals(fieldName)) { + deserializedVaultExtendedInfo.encryptionKeyThumbprint = reader.getString(); + } else if ("algorithm".equals(fieldName)) { + deserializedVaultExtendedInfo.algorithm = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultExtendedInfo; + }); + } } 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 c0f44d2fd1fb5..8dd873f34da75 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 @@ -6,7 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Vault extended information. @@ -16,15 +19,28 @@ public final class VaultExtendedInfoResourceInner extends ProxyResource { /* * Vault extended information. */ - @JsonProperty(value = "properties") private VaultExtendedInfo innerProperties; /* * Optional ETag. */ - @JsonProperty(value = "etag") private String etag; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of VaultExtendedInfoResourceInner class. */ @@ -60,6 +76,36 @@ public VaultExtendedInfoResourceInner withEtag(String etag) { return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the integrityKey property: Integrity key. * @@ -162,4 +208,51 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultExtendedInfoResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultExtendedInfoResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VaultExtendedInfoResourceInner. + */ + public static VaultExtendedInfoResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultExtendedInfoResourceInner deserializedVaultExtendedInfoResourceInner + = new VaultExtendedInfoResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVaultExtendedInfoResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVaultExtendedInfoResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVaultExtendedInfoResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVaultExtendedInfoResourceInner.innerProperties = VaultExtendedInfo.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVaultExtendedInfoResourceInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultExtendedInfoResourceInner; + }); + } } 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 9d68684085445..98241b64670c8 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 @@ -7,10 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.IdentityData; import com.azure.resourcemanager.recoveryservices.models.Sku; import com.azure.resourcemanager.recoveryservices.models.VaultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -21,33 +24,43 @@ public final class VaultInner extends Resource { /* * Identity for the resource. */ - @JsonProperty(value = "identity") private IdentityData identity; /* * Properties of the vault. */ - @JsonProperty(value = "properties") private VaultProperties properties; /* * Identifies the unique system identifier for each Azure 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; /* * Optional ETag. */ - @JsonProperty(value = "etag") private String etag; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of VaultInner class. */ @@ -143,6 +156,36 @@ public VaultInner withEtag(String etag) { return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -177,4 +220,65 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VaultInner. + */ + public static VaultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultInner deserializedVaultInner = new VaultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVaultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVaultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVaultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVaultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVaultInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedVaultInner.identity = IdentityData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedVaultInner.properties = VaultProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedVaultInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVaultInner.systemData = SystemData.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVaultInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultInner; + }); + } } 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 5e70c2e9b4b17..2dc42b38147fc 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,50 +5,50 @@ package com.azure.resourcemanager.recoveryservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.models.NameInfo; import com.azure.resourcemanager.recoveryservices.models.UsagesUnit; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Usages of a vault. */ @Fluent -public final class VaultUsageInner { +public final class VaultUsageInner implements JsonSerializable { /* * Unit of the usage. */ - @JsonProperty(value = "unit") private UsagesUnit unit; /* * Quota period of usage. */ - @JsonProperty(value = "quotaPeriod") private String quotaPeriod; /* * Next reset time of usage. */ - @JsonProperty(value = "nextResetTime") private OffsetDateTime nextResetTime; /* * Current value of usage. */ - @JsonProperty(value = "currentValue") private Long currentValue; /* * Limit of usage. */ - @JsonProperty(value = "limit") private Long limit; /* * Name of usage. */ - @JsonProperty(value = "name") private NameInfo name; /** @@ -187,4 +187,57 @@ public void validate() { name().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod); + jsonWriter.writeStringField("nextResetTime", + this.nextResetTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.nextResetTime)); + jsonWriter.writeNumberField("currentValue", this.currentValue); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeJsonField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultUsageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultUsageInner. + */ + public static VaultUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultUsageInner deserializedVaultUsageInner = new VaultUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedVaultUsageInner.unit = UsagesUnit.fromString(reader.getString()); + } else if ("quotaPeriod".equals(fieldName)) { + deserializedVaultUsageInner.quotaPeriod = reader.getString(); + } else if ("nextResetTime".equals(fieldName)) { + deserializedVaultUsageInner.nextResetTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("currentValue".equals(fieldName)) { + deserializedVaultUsageInner.currentValue = reader.getNullable(JsonReader::getLong); + } else if ("limit".equals(fieldName)) { + deserializedVaultUsageInner.limit = reader.getNullable(JsonReader::getLong); + } else if ("name".equals(fieldName)) { + deserializedVaultUsageInner.name = NameInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultUsageInner; + }); + } } 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 a1687eebedd2b..735bac0fe72e0 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 @@ -183,9 +183,7 @@ public PagedIterable list(Context context /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -211,9 +209,7 @@ private Mono> listNextSingl /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 3659ef8f833c8..9b5e5eea39fb0 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 @@ -370,9 +370,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String vaultName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -398,9 +396,7 @@ private Mono> listNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 ac5dd245afc19..c8c0d89d139f6 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 @@ -13,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; 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 4e89246510f52..3285e2ee4ada8 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 @@ -10,8 +10,8 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; -import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoResource; +import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; public final class VaultExtendedInfoesImpl implements VaultExtendedInfoes { private static final ClientLogger LOGGER = new ClientLogger(VaultExtendedInfoesImpl.class); 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 d5560152409e1..426c8ed203c6b 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 @@ -1268,9 +1268,7 @@ public VaultInner update(String resourceGroupName, String vaultName, PatchVault /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1298,9 +1296,7 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1327,9 +1323,7 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1357,9 +1351,7 @@ private Mono> listByResourceGroupNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AlertsState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AlertsState.java index 860e3aaa728ed..d805ada3d27d1 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AlertsState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AlertsState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AlertsState() { * @param name a name to look for. * @return the corresponding AlertsState. */ - @JsonCreator public static AlertsState fromString(String name) { return fromString(name, AlertsState.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java index b0155309a6ad9..b0a3184ce15dc 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public AuthType() { * @param name a name to look for. * @return the corresponding AuthType. */ - @JsonCreator public static AuthType fromString(String name) { return fromString(name, AuthType.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AzureMonitorAlertSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AzureMonitorAlertSettings.java index a1e5aa95ab5b3..21367cc1c7613 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AzureMonitorAlertSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AzureMonitorAlertSettings.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings for Azure Monitor based alerts. */ @Fluent -public final class AzureMonitorAlertSettings { +public final class AzureMonitorAlertSettings implements JsonSerializable { /* * The alertsForAllJobFailures property. */ - @JsonProperty(value = "alertsForAllJobFailures") private AlertsState alertsForAllJobFailures; /* * The alertsForAllReplicationIssues property. */ - @JsonProperty(value = "alertsForAllReplicationIssues") private AlertsState alertsForAllReplicationIssues; /* * The alertsForAllFailoverIssues property. */ - @JsonProperty(value = "alertsForAllFailoverIssues") private AlertsState alertsForAllFailoverIssues; /** @@ -103,4 +104,52 @@ public AzureMonitorAlertSettings withAlertsForAllFailoverIssues(AlertsState aler */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alertsForAllJobFailures", + this.alertsForAllJobFailures == null ? null : this.alertsForAllJobFailures.toString()); + jsonWriter.writeStringField("alertsForAllReplicationIssues", + this.alertsForAllReplicationIssues == null ? null : this.alertsForAllReplicationIssues.toString()); + jsonWriter.writeStringField("alertsForAllFailoverIssues", + this.alertsForAllFailoverIssues == null ? null : this.alertsForAllFailoverIssues.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureMonitorAlertSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureMonitorAlertSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureMonitorAlertSettings. + */ + public static AzureMonitorAlertSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureMonitorAlertSettings deserializedAzureMonitorAlertSettings = new AzureMonitorAlertSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertsForAllJobFailures".equals(fieldName)) { + deserializedAzureMonitorAlertSettings.alertsForAllJobFailures + = AlertsState.fromString(reader.getString()); + } else if ("alertsForAllReplicationIssues".equals(fieldName)) { + deserializedAzureMonitorAlertSettings.alertsForAllReplicationIssues + = AlertsState.fromString(reader.getString()); + } else if ("alertsForAllFailoverIssues".equals(fieldName)) { + deserializedAzureMonitorAlertSettings.alertsForAllFailoverIssues + = AlertsState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureMonitorAlertSettings; + }); + } } 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 index 01c4375ecc619..7f63ec8c97ffc 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public BackupStorageVersion() { * @param name a name to look for. * @return the corresponding BackupStorageVersion. */ - @JsonCreator public static BackupStorageVersion fromString(String name) { return fromString(name, BackupStorageVersion.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BcdrSecurityLevel.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BcdrSecurityLevel.java index 52aac0901984d..807497971d566 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BcdrSecurityLevel.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/BcdrSecurityLevel.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public BcdrSecurityLevel() { * @param name a name to look for. * @return the corresponding BcdrSecurityLevel. */ - @JsonCreator public static BcdrSecurityLevel fromString(String name) { return fromString(name, BcdrSecurityLevel.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesProperties.java index 56485bfc0fbda..cccfef29abe2a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesProperties.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesProperties.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Capabilities information. */ @Fluent -public final class CapabilitiesProperties { +public final class CapabilitiesProperties implements JsonSerializable { /* * The dnsZones property. */ - @JsonProperty(value = "dnsZones") private List dnsZones; /** @@ -55,4 +58,41 @@ public void validate() { dnsZones().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsZones", this.dnsZones, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitiesProperties. + */ + public static CapabilitiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesProperties deserializedCapabilitiesProperties = new CapabilitiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsZones".equals(fieldName)) { + List dnsZones = reader.readArray(reader1 -> DnsZone.fromJson(reader1)); + deserializedCapabilitiesProperties.dnsZones = dnsZones; + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesProperties; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesResponseProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesResponseProperties.java index f727ea0ec3a6f..3c966f1ae36ca 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesResponseProperties.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CapabilitiesResponseProperties.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Capabilities properties in response. */ @Fluent -public final class CapabilitiesResponseProperties { +public final class CapabilitiesResponseProperties implements JsonSerializable { /* * The dnsZones property. */ - @JsonProperty(value = "dnsZones") private List dnsZones; /** @@ -55,4 +58,42 @@ public void validate() { dnsZones().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsZones", this.dnsZones, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilitiesResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilitiesResponseProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilitiesResponseProperties. + */ + public static CapabilitiesResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilitiesResponseProperties deserializedCapabilitiesResponseProperties + = new CapabilitiesResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsZones".equals(fieldName)) { + List dnsZones = reader.readArray(reader1 -> DnsZoneResponse.fromJson(reader1)); + deserializedCapabilitiesResponseProperties.dnsZones = dnsZones; + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilitiesResponseProperties; + }); + } } 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 2bd5631cb91ba..5bb7887101bae 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,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of the certificate to be uploaded to the vault. */ @Fluent -public final class CertificateRequest { +public final class CertificateRequest implements JsonSerializable { /* * Raw certificate data. */ - @JsonProperty(value = "properties") private RawCertificateData properties; /** @@ -54,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateRequest. + */ + public static CertificateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateRequest deserializedCertificateRequest = new CertificateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedCertificateRequest.properties = RawCertificateData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateRequest; + }); + } } 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 98d32c76e6ddb..540583d88eec9 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,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Resource Name availability input parameters - Resource type and resource name. */ @Fluent -public final class CheckNameAvailabilityParameters { +public final class CheckNameAvailabilityParameters implements JsonSerializable { /* * Describes the Resource type: Microsoft.RecoveryServices/Vaults */ - @JsonProperty(value = "type") private String type; /* * Resource name for which availability needs to be checked */ - @JsonProperty(value = "name") private String name; /** @@ -77,4 +79,44 @@ public CheckNameAvailabilityParameters withName(String name) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityParameters. + */ + public static CheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityParameters deserializedCheckNameAvailabilityParameters + = new CheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityParameters.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityParameters.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityParameters; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClassicAlertSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClassicAlertSettings.java index efa7d13cb203d..881d31fd9e16a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClassicAlertSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClassicAlertSettings.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings for classic alerts. */ @Fluent -public final class ClassicAlertSettings { +public final class ClassicAlertSettings implements JsonSerializable { /* * The alertsForCriticalOperations property. */ - @JsonProperty(value = "alertsForCriticalOperations") private AlertsState alertsForCriticalOperations; /* * The emailNotificationsForSiteRecovery property. */ - @JsonProperty(value = "emailNotificationsForSiteRecovery") private AlertsState emailNotificationsForSiteRecovery; /** @@ -77,4 +79,47 @@ public ClassicAlertSettings withEmailNotificationsForSiteRecovery(AlertsState em */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alertsForCriticalOperations", + this.alertsForCriticalOperations == null ? null : this.alertsForCriticalOperations.toString()); + jsonWriter.writeStringField("emailNotificationsForSiteRecovery", + this.emailNotificationsForSiteRecovery == null ? null : this.emailNotificationsForSiteRecovery.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClassicAlertSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClassicAlertSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClassicAlertSettings. + */ + public static ClassicAlertSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClassicAlertSettings deserializedClassicAlertSettings = new ClassicAlertSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertsForCriticalOperations".equals(fieldName)) { + deserializedClassicAlertSettings.alertsForCriticalOperations + = AlertsState.fromString(reader.getString()); + } else if ("emailNotificationsForSiteRecovery".equals(fieldName)) { + deserializedClassicAlertSettings.emailNotificationsForSiteRecovery + = AlertsState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClassicAlertSettings; + }); + } } 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 05660b30c2cbd..f76b0bc515e88 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,35 +5,35 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information of an operation. */ @Fluent -public final class ClientDiscoveryDisplay { +public final class ClientDiscoveryDisplay implements JsonSerializable { /* * Name of the provider for display purposes */ - @JsonProperty(value = "provider") private String provider; /* * ResourceType for which this Operation can be performed. */ - @JsonProperty(value = "resource") private String resource; /* * Operations Name itself. */ - @JsonProperty(value = "operation") private String operation; /* * Description of the operation having details of what operation is about. */ - @JsonProperty(value = "description") private String description; /** @@ -129,4 +129,49 @@ public ClientDiscoveryDisplay withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryDisplay if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryDisplay. + */ + public static ClientDiscoveryDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryDisplay deserializedClientDiscoveryDisplay = new ClientDiscoveryDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedClientDiscoveryDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedClientDiscoveryDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedClientDiscoveryDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedClientDiscoveryDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryDisplay; + }); + } } 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 7d65c6f058f51..554641405ec31 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,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Class to represent shoebox log specification in json client discovery. */ @Fluent -public final class ClientDiscoveryForLogSpecification { +public final class ClientDiscoveryForLogSpecification implements JsonSerializable { /* * Name of the log. */ - @JsonProperty(value = "name") private String name; /* * Localized display name */ - @JsonProperty(value = "displayName") private String displayName; /* * Blobs created in customer storage account per hour */ - @JsonProperty(value = "blobDuration") private String blobDuration; /** @@ -103,4 +104,47 @@ public ClientDiscoveryForLogSpecification withBlobDuration(String blobDuration) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryForLogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryForLogSpecification if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryForLogSpecification. + */ + public static ClientDiscoveryForLogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryForLogSpecification deserializedClientDiscoveryForLogSpecification + = new ClientDiscoveryForLogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClientDiscoveryForLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedClientDiscoveryForLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedClientDiscoveryForLogSpecification.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryForLogSpecification; + }); + } } 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 e570b9637362d..c6e4fab2344ee 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,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Class to represent shoebox properties in json client discovery. */ @Fluent -public final class ClientDiscoveryForProperties { +public final class ClientDiscoveryForProperties implements JsonSerializable { /* * Operation properties. */ - @JsonProperty(value = "serviceSpecification") private ClientDiscoveryForServiceSpecification serviceSpecification; /** @@ -55,4 +58,41 @@ public void validate() { serviceSpecification().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryForProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryForProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryForProperties. + */ + public static ClientDiscoveryForProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryForProperties deserializedClientDiscoveryForProperties = new ClientDiscoveryForProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedClientDiscoveryForProperties.serviceSpecification + = ClientDiscoveryForServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryForProperties; + }); + } } 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 e560518f4be78..42e9376899ed3 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,18 +5,22 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Class to represent shoebox service specification in json client discovery. */ @Fluent -public final class ClientDiscoveryForServiceSpecification { +public final class ClientDiscoveryForServiceSpecification + implements JsonSerializable { /* * List of log specifications of this operation. */ - @JsonProperty(value = "logSpecifications") private List logSpecifications; /** @@ -56,4 +60,44 @@ public void validate() { logSpecifications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryForServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryForServiceSpecification if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryForServiceSpecification. + */ + public static ClientDiscoveryForServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryForServiceSpecification deserializedClientDiscoveryForServiceSpecification + = new ClientDiscoveryForServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> ClientDiscoveryForLogSpecification.fromJson(reader1)); + deserializedClientDiscoveryForServiceSpecification.logSpecifications = logSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryForServiceSpecification; + }); + } } 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 1f1d727b6e500..053e222922fbd 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,25 +5,27 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Operations List response which contains list of available APIs. */ @Fluent -public final class ClientDiscoveryResponse { +public final class ClientDiscoveryResponse implements JsonSerializable { /* * List of available operations. */ - @JsonProperty(value = "value") private List value; /* * Link to the next chunk of the response */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientDiscoveryResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientDiscoveryResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientDiscoveryResponse. + */ + public static ClientDiscoveryResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientDiscoveryResponse deserializedClientDiscoveryResponse = new ClientDiscoveryResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ClientDiscoveryValueForSingleApiInner.fromJson(reader1)); + deserializedClientDiscoveryResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClientDiscoveryResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClientDiscoveryResponse; + }); + } } 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 index 869844fab4d64..d6a74af564ac3 100644 --- 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 @@ -5,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The details of the identity used for CMK. */ @Fluent -public final class CmkKekIdentity { +public final class CmkKekIdentity implements JsonSerializable { /* * 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; /** @@ -81,4 +83,43 @@ public CmkKekIdentity withUserAssignedIdentity(String userAssignedIdentity) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("useSystemAssignedIdentity", this.useSystemAssignedIdentity); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CmkKekIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CmkKekIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CmkKekIdentity. + */ + public static CmkKekIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CmkKekIdentity deserializedCmkKekIdentity = new CmkKekIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("useSystemAssignedIdentity".equals(fieldName)) { + deserializedCmkKekIdentity.useSystemAssignedIdentity = reader.getNullable(JsonReader::getBoolean); + } else if ("userAssignedIdentity".equals(fieldName)) { + deserializedCmkKekIdentity.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCmkKekIdentity; + }); + } } 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 index 570a294b1dc28..614f2d6baeffc 100644 --- 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 @@ -5,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The properties of the Key Vault which hosts CMK. */ @Fluent -public final class CmkKeyVaultProperties { +public final class CmkKeyVaultProperties implements JsonSerializable { /* * The key uri of the Customer Managed Key */ - @JsonProperty(value = "keyUri") private String keyUri; /** @@ -51,4 +54,40 @@ public CmkKeyVaultProperties withKeyUri(String keyUri) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUri", this.keyUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CmkKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CmkKeyVaultProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CmkKeyVaultProperties. + */ + public static CmkKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CmkKeyVaultProperties deserializedCmkKeyVaultProperties = new CmkKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedCmkKeyVaultProperties.keyUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCmkKeyVaultProperties; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossRegionRestore.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossRegionRestore.java index b48c4f6d58111..440abeeb14605 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossRegionRestore.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossRegionRestore.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CrossRegionRestore() { * @param name a name to look for. * @return the corresponding CrossRegionRestore. */ - @JsonCreator public static CrossRegionRestore fromString(String name) { return fromString(name, CrossRegionRestore.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreSettings.java index 6883759f8a312..4f00ff122875b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreSettings.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings for Cross Subscription Restore Settings. */ @Fluent -public final class CrossSubscriptionRestoreSettings { +public final class CrossSubscriptionRestoreSettings implements JsonSerializable { /* * The crossSubscriptionRestoreState property. */ - @JsonProperty(value = "crossSubscriptionRestoreState") private CrossSubscriptionRestoreState crossSubscriptionRestoreState; /** @@ -52,4 +55,43 @@ public CrossSubscriptionRestoreState crossSubscriptionRestoreState() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("crossSubscriptionRestoreState", + this.crossSubscriptionRestoreState == null ? null : this.crossSubscriptionRestoreState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossSubscriptionRestoreSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossSubscriptionRestoreSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossSubscriptionRestoreSettings. + */ + public static CrossSubscriptionRestoreSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossSubscriptionRestoreSettings deserializedCrossSubscriptionRestoreSettings + = new CrossSubscriptionRestoreSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("crossSubscriptionRestoreState".equals(fieldName)) { + deserializedCrossSubscriptionRestoreSettings.crossSubscriptionRestoreState + = CrossSubscriptionRestoreState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossSubscriptionRestoreSettings; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreState.java index a1100c7a87e7c..4d8c7ed6e1a2b 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CrossSubscriptionRestoreState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public CrossSubscriptionRestoreState() { * @param name a name to look for. * @return the corresponding CrossSubscriptionRestoreState. */ - @JsonCreator public static CrossSubscriptionRestoreState fromString(String name) { return fromString(name, CrossSubscriptionRestoreState.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZone.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZone.java index ab4d146903ad3..a404116345681 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZone.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZone.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * DNSZone information. */ @Fluent -public class DnsZone { +public class DnsZone implements JsonSerializable { /* * Subresource type for vault AzureBackup, AzureBackup_secondary or AzureSiteRecovery */ - @JsonProperty(value = "subResource") private VaultSubResourceType subResource; /** @@ -51,4 +54,40 @@ public DnsZone withSubResource(VaultSubResourceType subResource) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subResource", this.subResource == null ? null : this.subResource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsZone from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsZone if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the DnsZone. + */ + public static DnsZone fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsZone deserializedDnsZone = new DnsZone(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subResource".equals(fieldName)) { + deserializedDnsZone.subResource = VaultSubResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDnsZone; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZoneResponse.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZoneResponse.java index e35636a7c01a8..62c7b3aee3cc5 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZoneResponse.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/DnsZoneResponse.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,7 +19,6 @@ public final class DnsZoneResponse extends DnsZone { /* * The private link resource Private link DNS zone names. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; /** @@ -61,6 +63,46 @@ public DnsZoneResponse withSubResource(VaultSubResourceType subResource) { */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subResource", subResource() == null ? null : subResource().toString()); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsZoneResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsZoneResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DnsZoneResponse. + */ + public static DnsZoneResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsZoneResponse deserializedDnsZoneResponse = new DnsZoneResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subResource".equals(fieldName)) { + deserializedDnsZoneResponse.withSubResource(VaultSubResourceType.fromString(reader.getString())); + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedDnsZoneResponse.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedDnsZoneResponse; + }); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/EnhancedSecurityState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/EnhancedSecurityState.java index 54d2a7a5fd5db..b93967e6f5037 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/EnhancedSecurityState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/EnhancedSecurityState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public EnhancedSecurityState() { * @param name a name to look for. * @return the corresponding EnhancedSecurityState. */ - @JsonCreator public static EnhancedSecurityState fromString(String name) { return fromString(name, EnhancedSecurityState.class); } 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 dc8c67931a280..303707ed2acba 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,38 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Identity for the resource. */ @Fluent -public final class IdentityData { +public final class IdentityData implements JsonSerializable { /* * The principal ID of resource identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The tenant ID of resource. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* - * 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. + * 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}'. + * 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; /** @@ -130,4 +132,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(IdentityData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IdentityData. + */ + public static IdentityData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityData deserializedIdentityData = new IdentityData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIdentityData.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedIdentityData.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentityData.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserIdentity.fromJson(reader1)); + deserializedIdentityData.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityData; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilitySettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilitySettings.java index 2fc6b57b700d3..1f87b6fcbb2db 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilitySettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilitySettings.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Immutability Settings of vault. */ @Fluent -public final class ImmutabilitySettings { +public final class ImmutabilitySettings implements JsonSerializable { /* * The state property. */ - @JsonProperty(value = "state") private ImmutabilityState state; /** @@ -51,4 +54,40 @@ public ImmutabilitySettings withState(ImmutabilityState state) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilitySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilitySettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImmutabilitySettings. + */ + public static ImmutabilitySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilitySettings deserializedImmutabilitySettings = new ImmutabilitySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedImmutabilitySettings.state = ImmutabilityState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilitySettings; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilityState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilityState.java index f8bbda71513a4..a07e50dabdb9e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilityState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ImmutabilityState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ImmutabilityState() { * @param name a name to look for. * @return the corresponding ImmutabilityState. */ - @JsonCreator public static ImmutabilityState fromString(String name) { return fromString(name, ImmutabilityState.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 index 996a6406da061..df9728c7a5323 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public InfrastructureEncryptionState() { * @param name a name to look for. * @return the corresponding InfrastructureEncryptionState. */ - @JsonCreator public static InfrastructureEncryptionState fromString(String name) { return fromString(name, 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 66b62da46102a..f18fd358b8237 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,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Summary of the replication job data for this vault. */ @Fluent -public final class JobsSummary { +public final class JobsSummary implements JsonSerializable { /* * Count of failed jobs. */ - @JsonProperty(value = "failedJobs") private Integer failedJobs; /* * Count of suspended jobs. */ - @JsonProperty(value = "suspendedJobs") private Integer suspendedJobs; /* * Count of in-progress jobs. */ - @JsonProperty(value = "inProgressJobs") private Integer inProgressJobs; /** @@ -103,4 +104,46 @@ public JobsSummary withInProgressJobs(Integer inProgressJobs) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("failedJobs", this.failedJobs); + jsonWriter.writeNumberField("suspendedJobs", this.suspendedJobs); + jsonWriter.writeNumberField("inProgressJobs", this.inProgressJobs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobsSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobsSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobsSummary. + */ + public static JobsSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobsSummary deserializedJobsSummary = new JobsSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failedJobs".equals(fieldName)) { + deserializedJobsSummary.failedJobs = reader.getNullable(JsonReader::getInt); + } else if ("suspendedJobs".equals(fieldName)) { + deserializedJobsSummary.suspendedJobs = reader.getNullable(JsonReader::getInt); + } else if ("inProgressJobs".equals(fieldName)) { + deserializedJobsSummary.inProgressJobs = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedJobsSummary; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSettings.java index a55ae36524c8a..cd1e868cb9d31 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSettings.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Monitoring Settings of the vault. */ @Fluent -public final class MonitoringSettings { +public final class MonitoringSettings implements JsonSerializable { /* * Settings for Azure Monitor based alerts */ - @JsonProperty(value = "azureMonitorAlertSettings") private AzureMonitorAlertSettings azureMonitorAlertSettings; /* * Settings for classic alerts */ - @JsonProperty(value = "classicAlertSettings") private ClassicAlertSettings classicAlertSettings; /** @@ -83,4 +85,44 @@ public void validate() { classicAlertSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureMonitorAlertSettings", this.azureMonitorAlertSettings); + jsonWriter.writeJsonField("classicAlertSettings", this.classicAlertSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringSettings. + */ + public static MonitoringSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringSettings deserializedMonitoringSettings = new MonitoringSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureMonitorAlertSettings".equals(fieldName)) { + deserializedMonitoringSettings.azureMonitorAlertSettings + = AzureMonitorAlertSettings.fromJson(reader); + } else if ("classicAlertSettings".equals(fieldName)) { + deserializedMonitoringSettings.classicAlertSettings = ClassicAlertSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringSettings; + }); + } } 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 948d0e250b0f0..61a960be741fd 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,47 +5,45 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Summary of the replication monitoring data for this vault. */ @Fluent -public final class MonitoringSummary { +public final class MonitoringSummary implements JsonSerializable { /* * Count of unhealthy VMs. */ - @JsonProperty(value = "unHealthyVmCount") private Integer unHealthyVmCount; /* * Count of unhealthy replication providers. */ - @JsonProperty(value = "unHealthyProviderCount") private Integer unHealthyProviderCount; /* * Count of all critical warnings. */ - @JsonProperty(value = "eventsCount") private Integer eventsCount; /* * Count of all deprecated recovery service providers. */ - @JsonProperty(value = "deprecatedProviderCount") private Integer deprecatedProviderCount; /* * Count of all the supported recovery service providers. */ - @JsonProperty(value = "supportedProviderCount") private Integer supportedProviderCount; /* * Count of all the unsupported recovery service providers. */ - @JsonProperty(value = "unsupportedProviderCount") private Integer unsupportedProviderCount; /** @@ -181,4 +179,55 @@ public MonitoringSummary withUnsupportedProviderCount(Integer unsupportedProvide */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("unHealthyVmCount", this.unHealthyVmCount); + jsonWriter.writeNumberField("unHealthyProviderCount", this.unHealthyProviderCount); + jsonWriter.writeNumberField("eventsCount", this.eventsCount); + jsonWriter.writeNumberField("deprecatedProviderCount", this.deprecatedProviderCount); + jsonWriter.writeNumberField("supportedProviderCount", this.supportedProviderCount); + jsonWriter.writeNumberField("unsupportedProviderCount", this.unsupportedProviderCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringSummary. + */ + public static MonitoringSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringSummary deserializedMonitoringSummary = new MonitoringSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unHealthyVmCount".equals(fieldName)) { + deserializedMonitoringSummary.unHealthyVmCount = reader.getNullable(JsonReader::getInt); + } else if ("unHealthyProviderCount".equals(fieldName)) { + deserializedMonitoringSummary.unHealthyProviderCount = reader.getNullable(JsonReader::getInt); + } else if ("eventsCount".equals(fieldName)) { + deserializedMonitoringSummary.eventsCount = reader.getNullable(JsonReader::getInt); + } else if ("deprecatedProviderCount".equals(fieldName)) { + deserializedMonitoringSummary.deprecatedProviderCount = reader.getNullable(JsonReader::getInt); + } else if ("supportedProviderCount".equals(fieldName)) { + deserializedMonitoringSummary.supportedProviderCount = reader.getNullable(JsonReader::getInt); + } else if ("unsupportedProviderCount".equals(fieldName)) { + deserializedMonitoringSummary.unsupportedProviderCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringSummary; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MultiUserAuthorization.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MultiUserAuthorization.java index c201d9319e950..1eeb4cc2ca047 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MultiUserAuthorization.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MultiUserAuthorization.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public MultiUserAuthorization() { * @param name a name to look for. * @return the corresponding MultiUserAuthorization. */ - @JsonCreator public static MultiUserAuthorization fromString(String name) { return fromString(name, MultiUserAuthorization.class); } 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 f1b233e92d5e6..52bc79264fe35 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,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The name of usage. */ @Fluent -public final class NameInfo { +public final class NameInfo implements JsonSerializable { /* * Value of usage. */ - @JsonProperty(value = "value") private String value; /* * Localized value of usage. */ - @JsonProperty(value = "localizedValue") private String localizedValue; /** @@ -77,4 +79,43 @@ public NameInfo withLocalizedValue(String localizedValue) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the NameInfo. + */ + public static NameInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameInfo deserializedNameInfo = new NameInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNameInfo.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedNameInfo.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameInfo; + }); + } } 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 219cf07f8f85b..dd4e1f62dabfd 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,8 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -18,22 +20,33 @@ public class PatchTrackedResource extends ProxyResource { /* * Resource location. */ - @JsonProperty(value = "location") private String location; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Optional ETag. */ - @JsonProperty(value = "etag") private String etag; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PatchTrackedResource class. */ @@ -100,6 +113,36 @@ public PatchTrackedResource withEtag(String etag) { return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Validates the instance. * @@ -107,4 +150,54 @@ public PatchTrackedResource withEtag(String etag) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchTrackedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchTrackedResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatchTrackedResource. + */ + public static PatchTrackedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchTrackedResource deserializedPatchTrackedResource = new PatchTrackedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPatchTrackedResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPatchTrackedResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPatchTrackedResource.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPatchTrackedResource.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPatchTrackedResource.tags = tags; + } else if ("etag".equals(fieldName)) { + deserializedPatchTrackedResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchTrackedResource; + }); + } } 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 9373dbbe2e8db..864fadf52b904 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,7 +5,10 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -16,21 +19,33 @@ public final class PatchVault extends PatchTrackedResource { /* * Properties of the vault. */ - @JsonProperty(value = "properties") private VaultProperties properties; /* * Identifies the unique system identifier for each Azure resource. */ - @JsonProperty(value = "sku") private Sku sku; /* * Identity for the resource. */ - @JsonProperty(value = "identity") private IdentityData identity; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PatchVault class. */ @@ -97,6 +112,36 @@ public PatchVault withIdentity(IdentityData identity) { return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -131,7 +176,6 @@ public PatchVault withEtag(String etag) { */ @Override public void validate() { - super.validate(); if (properties() != null) { properties().validate(); } @@ -142,4 +186,63 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchVault from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchVault if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatchVault. + */ + public static PatchVault fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchVault deserializedPatchVault = new PatchVault(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPatchVault.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPatchVault.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPatchVault.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPatchVault.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPatchVault.withTags(tags); + } else if ("etag".equals(fieldName)) { + deserializedPatchVault.withEtag(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPatchVault.properties = VaultProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPatchVault.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedPatchVault.identity = IdentityData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchVault; + }); + } } 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 06061a180334a..213c20c65c7cd 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,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Private Endpoint network resource that is linked to the Private Endpoint connection. */ @Immutable -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* * Gets or sets id. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** @@ -40,4 +43,39 @@ public String id() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/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 da9c11083be2b..b4b6912f29e84 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,36 +5,36 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Private Endpoint Connection Response Properties. */ @Fluent -public final class PrivateEndpointConnection { +public final class PrivateEndpointConnection implements JsonSerializable { /* * Gets or sets provisioning state of the private endpoint connection. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The Private Endpoint network resource that is linked to the Private Endpoint connection. */ - @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpoint privateEndpoint; /* * Gets or sets private link service connection state. */ - @JsonProperty(value = "privateLinkServiceConnectionState", access = JsonProperty.Access.WRITE_ONLY) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * Group Ids for the Private Endpoint */ - @JsonProperty(value = "groupIds") private List groupIds; /** @@ -104,4 +104,51 @@ public void validate() { privateLinkServiceConnectionState().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groupIds", this.groupIds, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnection. + */ + public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnection deserializedPrivateEndpointConnection = new PrivateEndpointConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnection.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnection.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnection.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds + = reader.readArray(reader1 -> VaultSubResourceType.fromString(reader1.getString())); + deserializedPrivateEndpointConnection.groupIds = groupIds; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnection; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java index 792e56bfe1470..e4f7437a325e6 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public PrivateEndpointConnectionStatus() { * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionStatus. */ - @JsonCreator public static PrivateEndpointConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointConnectionStatus.class); } 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 dee137d0236c8..6bf8bb591d5e7 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,41 +5,43 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Information to be stored in Vault properties as an element of privateEndpointConnections List. */ @Immutable -public final class PrivateEndpointConnectionVaultProperties { +public final class PrivateEndpointConnectionVaultProperties + implements JsonSerializable { /* - * Format of id subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. + * Format of id + * subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{ + * resourceName}/privateEndpointConnections/{connectionName}. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Private Endpoint Connection Response Properties. */ - @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; /** @@ -105,4 +107,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionVaultProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionVaultProperties. + */ + public static PrivateEndpointConnectionVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionVaultProperties deserializedPrivateEndpointConnectionVaultProperties + = new PrivateEndpointConnectionVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionVaultProperties.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionVaultProperties.properties + = PrivateEndpointConnection.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionVaultProperties.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionVaultProperties.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPrivateEndpointConnectionVaultProperties.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionVaultProperties; + }); + } } 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 1ab065a6307f9..446b85cb704c0 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,25 +5,27 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Class which represent the stamps associated with the vault. */ @Fluent -public final class PrivateLinkResources { +public final class PrivateLinkResources implements JsonSerializable { /* * A collection of private link resources */ - @JsonProperty(value = "value") private List value; /* * Link to the next chunk of the response */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResources if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResources. + */ + public static PrivateLinkResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResources deserializedPrivateLinkResources = new PrivateLinkResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResources.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResources.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResources; + }); + } } 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 005a809186e0f..3223e0aa33f01 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,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets private link service connection state. */ @Immutable -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Gets or sets the status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionStatus status; /* * Gets or sets description. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* * Gets or sets actions required. */ - @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) private String actionsRequired; /** @@ -70,4 +71,45 @@ public String actionsRequired() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java index 46d87417f608f..787907794172a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ProvisioningState() { * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PublicNetworkAccess.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PublicNetworkAccess.java index cad6b264c9cad..6dd95e9cddb49 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PublicNetworkAccess.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PublicNetworkAccess.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public PublicNetworkAccess() { * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } 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 1a3d13aecf0ea..2b98976ab5cf0 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,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Raw certificate data. */ @Fluent -public final class RawCertificateData { +public final class RawCertificateData implements JsonSerializable { /* * Specifies the authentication type. */ - @JsonProperty(value = "authType") private AuthType authType; /* * The base64 encoded certificate raw data string */ - @JsonProperty(value = "certificate") private byte[] certificate; /** @@ -78,4 +80,43 @@ public RawCertificateData withCertificate(byte[] certificate) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeBinaryField("certificate", this.certificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RawCertificateData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RawCertificateData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RawCertificateData. + */ + public static RawCertificateData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RawCertificateData deserializedRawCertificateData = new RawCertificateData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedRawCertificateData.authType = AuthType.fromString(reader.getString()); + } else if ("certificate".equals(fieldName)) { + deserializedRawCertificateData.certificate = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedRawCertificateData; + }); + } } 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 8276b3ab897fc..2424a42f4fd52 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,19 +5,22 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Replication usages for vault. */ @Fluent -public final class ReplicationUsageList { +public final class ReplicationUsageList implements JsonSerializable { /* * The list of replication usages for the given vault. */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +59,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationUsageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationUsageList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationUsageList. + */ + public static ReplicationUsageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationUsageList deserializedReplicationUsageList = new ReplicationUsageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ReplicationUsageInner.fromJson(reader1)); + deserializedReplicationUsageList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationUsageList; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilities.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilities.java index c7dd4f03cd8f1..1deb4c38c7331 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilities.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilities.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Input to get capabilities information for Microsoft.RecoveryServices. @@ -15,7 +19,6 @@ public final class ResourceCapabilities extends ResourceCapabilitiesBase { /* * Capabilities information */ - @JsonProperty(value = "properties") private CapabilitiesProperties properties; /** @@ -60,9 +63,54 @@ public ResourceCapabilities withType(String type) { */ @Override public void validate() { - super.validate(); if (properties() != null) { properties().validate(); } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ResourceCapabilities")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceCapabilities.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCapabilities if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceCapabilities. + */ + public static ResourceCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCapabilities deserializedResourceCapabilities = new ResourceCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceCapabilities.withType(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedResourceCapabilities.properties = CapabilitiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCapabilities; + }); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilitiesBase.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilitiesBase.java index 3939a41f1c2c1..68841af648351 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilitiesBase.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCapabilitiesBase.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Base class for request and response capabilities information for Microsoft.RecoveryServices. */ @Fluent -public class ResourceCapabilitiesBase { +public class ResourceCapabilitiesBase implements JsonSerializable { /* * Describes the Resource type: Microsoft.RecoveryServices/Vaults */ - @JsonProperty(value = "type", required = true) private String type; /** @@ -58,4 +61,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ResourceCapabilitiesBase.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCapabilitiesBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCapabilitiesBase if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceCapabilitiesBase. + */ + public static ResourceCapabilitiesBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCapabilitiesBase deserializedResourceCapabilitiesBase = new ResourceCapabilitiesBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceCapabilitiesBase.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCapabilitiesBase; + }); + } } 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 23e8ce0e433b7..d05b3e5d74c8f 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 @@ -5,71 +5,59 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Certificate details representing the Vault credentials for AAD. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "authType", - defaultImpl = ResourceCertificateAndAadDetails.class, - visible = true) -@JsonTypeName("AzureActiveDirectory") @Fluent public final class ResourceCertificateAndAadDetails extends ResourceCertificateDetails { /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. */ - @JsonTypeId - @JsonProperty(value = "authType", required = true) private String authType = "AzureActiveDirectory"; /* * AAD tenant authority. */ - @JsonProperty(value = "aadAuthority", required = true) private String aadAuthority; /* * AAD tenant Id. */ - @JsonProperty(value = "aadTenantId", required = true) private String aadTenantId; /* * AAD service principal clientId. */ - @JsonProperty(value = "servicePrincipalClientId", required = true) private String servicePrincipalClientId; /* * AAD service principal ObjectId. */ - @JsonProperty(value = "servicePrincipalObjectId", required = true) private String servicePrincipalObjectId; /* * Azure Management Endpoint Audience. */ - @JsonProperty(value = "azureManagementEndpointAudience", required = true) private String azureManagementEndpointAudience; /* * Service Resource Id. */ - @JsonProperty(value = "serviceResourceId") private String serviceResourceId; /* * AAD audience for the resource */ - @JsonProperty(value = "aadAudience") private String aadAudience; /** @@ -309,7 +297,6 @@ public ResourceCertificateAndAadDetails withValidTo(OffsetDateTime validTo) { */ @Override public void validate() { - super.validate(); if (aadAuthority() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( @@ -338,4 +325,92 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ResourceCertificateAndAadDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBinaryField("certificate", certificate()); + jsonWriter.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("issuer", issuer()); + jsonWriter.writeNumberField("resourceId", resourceId()); + jsonWriter.writeStringField("subject", subject()); + jsonWriter.writeStringField("thumbprint", thumbprint()); + jsonWriter.writeStringField("validFrom", + validFrom() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(validFrom())); + jsonWriter.writeStringField("validTo", + validTo() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(validTo())); + jsonWriter.writeStringField("aadAuthority", this.aadAuthority); + jsonWriter.writeStringField("aadTenantId", this.aadTenantId); + jsonWriter.writeStringField("servicePrincipalClientId", this.servicePrincipalClientId); + jsonWriter.writeStringField("servicePrincipalObjectId", this.servicePrincipalObjectId); + jsonWriter.writeStringField("azureManagementEndpointAudience", this.azureManagementEndpointAudience); + jsonWriter.writeStringField("authType", this.authType); + jsonWriter.writeStringField("serviceResourceId", this.serviceResourceId); + jsonWriter.writeStringField("aadAudience", this.aadAudience); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCertificateAndAadDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCertificateAndAadDetails if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceCertificateAndAadDetails. + */ + public static ResourceCertificateAndAadDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCertificateAndAadDetails deserializedResourceCertificateAndAadDetails + = new ResourceCertificateAndAadDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificate".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withCertificate(reader.getBinary()); + } else if ("friendlyName".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withFriendlyName(reader.getString()); + } else if ("issuer".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withIssuer(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails + .withResourceId(reader.getNullable(JsonReader::getLong)); + } else if ("subject".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withSubject(reader.getString()); + } else if ("thumbprint".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withThumbprint(reader.getString()); + } else if ("validFrom".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withValidFrom(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("validTo".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.withValidTo(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("aadAuthority".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.aadAuthority = reader.getString(); + } else if ("aadTenantId".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.aadTenantId = reader.getString(); + } else if ("servicePrincipalClientId".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.servicePrincipalClientId = reader.getString(); + } else if ("servicePrincipalObjectId".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.servicePrincipalObjectId = reader.getString(); + } else if ("azureManagementEndpointAudience".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.azureManagementEndpointAudience = reader.getString(); + } else if ("authType".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.authType = reader.getString(); + } else if ("serviceResourceId".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.serviceResourceId = reader.getString(); + } else if ("aadAudience".equals(fieldName)) { + deserializedResourceCertificateAndAadDetails.aadAudience = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCertificateAndAadDetails; + }); + } } 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 b2b1ba5d5617d..69d34e25ebf0c 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 @@ -5,47 +5,39 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Certificate details representing the Vault credentials for ACS. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "authType", - defaultImpl = ResourceCertificateAndAcsDetails.class, - visible = true) -@JsonTypeName("AccessControlService") @Fluent public final class ResourceCertificateAndAcsDetails extends ResourceCertificateDetails { /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. */ - @JsonTypeId - @JsonProperty(value = "authType", required = true) private String authType = "AccessControlService"; /* * ACS namespace name - tenant for our service. */ - @JsonProperty(value = "globalAcsNamespace", required = true) private String globalAcsNamespace; /* * Acs mgmt host name to connect to. */ - @JsonProperty(value = "globalAcsHostName", required = true) private String globalAcsHostname; /* * Global ACS namespace RP realm. */ - @JsonProperty(value = "globalAcsRPRealm", required = true) private String globalAcsRPRealm; /** @@ -204,7 +196,6 @@ public ResourceCertificateAndAcsDetails withValidTo(OffsetDateTime validTo) { */ @Override public void validate() { - super.validate(); if (globalAcsNamespace() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( @@ -223,4 +214,80 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ResourceCertificateAndAcsDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBinaryField("certificate", certificate()); + jsonWriter.writeStringField("friendlyName", friendlyName()); + jsonWriter.writeStringField("issuer", issuer()); + jsonWriter.writeNumberField("resourceId", resourceId()); + jsonWriter.writeStringField("subject", subject()); + jsonWriter.writeStringField("thumbprint", thumbprint()); + jsonWriter.writeStringField("validFrom", + validFrom() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(validFrom())); + jsonWriter.writeStringField("validTo", + validTo() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(validTo())); + jsonWriter.writeStringField("globalAcsNamespace", this.globalAcsNamespace); + jsonWriter.writeStringField("globalAcsHostName", this.globalAcsHostname); + jsonWriter.writeStringField("globalAcsRPRealm", this.globalAcsRPRealm); + jsonWriter.writeStringField("authType", this.authType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCertificateAndAcsDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCertificateAndAcsDetails if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceCertificateAndAcsDetails. + */ + public static ResourceCertificateAndAcsDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCertificateAndAcsDetails deserializedResourceCertificateAndAcsDetails + = new ResourceCertificateAndAcsDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificate".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withCertificate(reader.getBinary()); + } else if ("friendlyName".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withFriendlyName(reader.getString()); + } else if ("issuer".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withIssuer(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails + .withResourceId(reader.getNullable(JsonReader::getLong)); + } else if ("subject".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withSubject(reader.getString()); + } else if ("thumbprint".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withThumbprint(reader.getString()); + } else if ("validFrom".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withValidFrom(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("validTo".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.withValidTo(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("globalAcsNamespace".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.globalAcsNamespace = reader.getString(); + } else if ("globalAcsHostName".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.globalAcsHostname = reader.getString(); + } else if ("globalAcsRPRealm".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.globalAcsRPRealm = reader.getString(); + } else if ("authType".equals(fieldName)) { + deserializedResourceCertificateAndAcsDetails.authType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCertificateAndAcsDetails; + }); + } } 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 72a2ee6794a2e..2793eaffd031b 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,87 +6,69 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Certificate details representing the Vault credentials. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "authType", - defaultImpl = ResourceCertificateDetails.class, - visible = true) -@JsonTypeName("ResourceCertificateDetails") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AzureActiveDirectory", value = ResourceCertificateAndAadDetails.class), - @JsonSubTypes.Type(name = "AccessControlService", value = ResourceCertificateAndAcsDetails.class) }) @Fluent -public class ResourceCertificateDetails { +public class ResourceCertificateDetails implements JsonSerializable { /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. + * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of + * types. */ - @JsonTypeId - @JsonProperty(value = "authType", required = true) - private String authType; + private String authType = "ResourceCertificateDetails"; /* * The base64 encoded certificate raw data string. */ - @JsonProperty(value = "certificate") private byte[] certificate; /* * Certificate friendly name. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Certificate issuer. */ - @JsonProperty(value = "issuer") private String issuer; /* * Resource ID of the vault. */ - @JsonProperty(value = "resourceId") private Long resourceId; /* * Certificate Subject Name. */ - @JsonProperty(value = "subject") private String subject; /* * Certificate thumbprint. */ - @JsonProperty(value = "thumbprint") private String thumbprint; /* * Certificate Validity start Date time. */ - @JsonProperty(value = "validFrom") private OffsetDateTime validFrom; /* * Certificate Validity End Date time. */ - @JsonProperty(value = "validTo") private OffsetDateTime validTo; /** * Creates an instance of ResourceCertificateDetails class. */ public ResourceCertificateDetails() { - this.authType = "ResourceCertificateDetails"; } /** @@ -266,4 +248,95 @@ public ResourceCertificateDetails withValidTo(OffsetDateTime validTo) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType); + jsonWriter.writeBinaryField("certificate", this.certificate); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeNumberField("resourceId", this.resourceId); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeStringField("thumbprint", this.thumbprint); + jsonWriter.writeStringField("validFrom", + this.validFrom == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.validFrom)); + jsonWriter.writeStringField("validTo", + this.validTo == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.validTo)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceCertificateDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceCertificateDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceCertificateDetails. + */ + public static ResourceCertificateDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("authType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureActiveDirectory".equals(discriminatorValue)) { + return ResourceCertificateAndAadDetails.fromJson(readerToUse.reset()); + } else if ("AccessControlService".equals(discriminatorValue)) { + return ResourceCertificateAndAcsDetails.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ResourceCertificateDetails fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceCertificateDetails deserializedResourceCertificateDetails = new ResourceCertificateDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedResourceCertificateDetails.authType = reader.getString(); + } else if ("certificate".equals(fieldName)) { + deserializedResourceCertificateDetails.certificate = reader.getBinary(); + } else if ("friendlyName".equals(fieldName)) { + deserializedResourceCertificateDetails.friendlyName = reader.getString(); + } else if ("issuer".equals(fieldName)) { + deserializedResourceCertificateDetails.issuer = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceCertificateDetails.resourceId = reader.getNullable(JsonReader::getLong); + } else if ("subject".equals(fieldName)) { + deserializedResourceCertificateDetails.subject = reader.getString(); + } else if ("thumbprint".equals(fieldName)) { + deserializedResourceCertificateDetails.thumbprint = reader.getString(); + } else if ("validFrom".equals(fieldName)) { + deserializedResourceCertificateDetails.validFrom = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("validTo".equals(fieldName)) { + deserializedResourceCertificateDetails.validTo = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceCertificateDetails; + }); + } } 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 bb08b2b6cf38a..c29b8ee036b3f 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ResourceIdentityType() { * @param name a name to look for. * @return the corresponding ResourceIdentityType. */ - @JsonCreator public static ResourceIdentityType fromString(String name) { return fromString(name, ResourceIdentityType.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceMoveState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceMoveState.java index 4c05fac33b87a..07a2be2eb613f 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceMoveState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceMoveState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -77,7 +76,6 @@ public ResourceMoveState() { * @param name a name to look for. * @return the corresponding ResourceMoveState. */ - @JsonCreator public static ResourceMoveState fromString(String name) { return fromString(name, ResourceMoveState.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RestoreSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RestoreSettings.java index d1ae91a0c79a1..ed6286321d716 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RestoreSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RestoreSettings.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Restore Settings of the vault. */ @Fluent -public final class RestoreSettings { +public final class RestoreSettings implements JsonSerializable { /* * Settings for CrossSubscriptionRestore */ - @JsonProperty(value = "crossSubscriptionRestoreSettings") private CrossSubscriptionRestoreSettings crossSubscriptionRestoreSettings; /** @@ -55,4 +58,41 @@ public void validate() { crossSubscriptionRestoreSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("crossSubscriptionRestoreSettings", this.crossSubscriptionRestoreSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestoreSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestoreSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RestoreSettings. + */ + public static RestoreSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestoreSettings deserializedRestoreSettings = new RestoreSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("crossSubscriptionRestoreSettings".equals(fieldName)) { + deserializedRestoreSettings.crossSubscriptionRestoreSettings + = CrossSubscriptionRestoreSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRestoreSettings; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecureScoreLevel.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecureScoreLevel.java index 865f5f1bdb594..0720c46f6ca55 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecureScoreLevel.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecureScoreLevel.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public SecureScoreLevel() { * @param name a name to look for. * @return the corresponding SecureScoreLevel. */ - @JsonCreator public static SecureScoreLevel fromString(String name) { return fromString(name, SecureScoreLevel.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecuritySettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecuritySettings.java index 42afbe58c03d5..3da606810e8d4 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecuritySettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SecuritySettings.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Security Settings of the vault. */ @Fluent -public final class SecuritySettings { +public final class SecuritySettings implements JsonSerializable { /* * Immutability Settings of a vault */ - @JsonProperty(value = "immutabilitySettings") private ImmutabilitySettings immutabilitySettings; /* * Soft delete Settings of a vault */ - @JsonProperty(value = "softDeleteSettings") private SoftDeleteSettings softDeleteSettings; /* * MUA Settings of a vault */ - @JsonProperty(value = "multiUserAuthorization", access = JsonProperty.Access.WRITE_ONLY) private MultiUserAuthorization multiUserAuthorization; /** @@ -98,4 +99,46 @@ public void validate() { softDeleteSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("immutabilitySettings", this.immutabilitySettings); + jsonWriter.writeJsonField("softDeleteSettings", this.softDeleteSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecuritySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecuritySettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecuritySettings. + */ + public static SecuritySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecuritySettings deserializedSecuritySettings = new SecuritySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("immutabilitySettings".equals(fieldName)) { + deserializedSecuritySettings.immutabilitySettings = ImmutabilitySettings.fromJson(reader); + } else if ("softDeleteSettings".equals(fieldName)) { + deserializedSecuritySettings.softDeleteSettings = SoftDeleteSettings.fromJson(reader); + } else if ("multiUserAuthorization".equals(fieldName)) { + deserializedSecuritySettings.multiUserAuthorization + = MultiUserAuthorization.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecuritySettings; + }); + } } 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 7628975c64bfa..fb74243795c6d 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,41 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Identifies the unique system identifier for each Azure resource. */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* - * Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on backend storage redundancy or any other vault settings. To manage storage redundancy, use the backupstorageconfig + * Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on + * backend storage redundancy or any other vault settings. To manage storage redundancy, use the backupstorageconfig */ - @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; /** @@ -165,4 +165,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedSku.family = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedSku.size = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedSku.capacity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java index 79ea83d824fcc..4c2bd1276be66 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public SkuName() { * @param name a name to look for. * @return the corresponding SkuName. */ - @JsonCreator public static SkuName fromString(String name) { return fromString(name, SkuName.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteSettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteSettings.java index 629d5a83a8b0b..1ae17ea2fa828 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteSettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteSettings.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Soft delete Settings of vault. */ @Fluent -public final class SoftDeleteSettings { +public final class SoftDeleteSettings implements JsonSerializable { /* * The softDeleteState property. */ - @JsonProperty(value = "softDeleteState") private SoftDeleteState softDeleteState; /* * Soft delete retention period in days */ - @JsonProperty(value = "softDeleteRetentionPeriodInDays") private Integer softDeleteRetentionPeriodInDays; /* * The enhancedSecurityState property. */ - @JsonProperty(value = "enhancedSecurityState") private EnhancedSecurityState enhancedSecurityState; /** @@ -103,4 +104,50 @@ public SoftDeleteSettings withEnhancedSecurityState(EnhancedSecurityState enhanc */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("softDeleteState", + this.softDeleteState == null ? null : this.softDeleteState.toString()); + jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", this.softDeleteRetentionPeriodInDays); + jsonWriter.writeStringField("enhancedSecurityState", + this.enhancedSecurityState == null ? null : this.enhancedSecurityState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeleteSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeleteSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeleteSettings. + */ + public static SoftDeleteSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeleteSettings deserializedSoftDeleteSettings = new SoftDeleteSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softDeleteState".equals(fieldName)) { + deserializedSoftDeleteSettings.softDeleteState = SoftDeleteState.fromString(reader.getString()); + } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { + deserializedSoftDeleteSettings.softDeleteRetentionPeriodInDays + = reader.getNullable(JsonReader::getInt); + } else if ("enhancedSecurityState".equals(fieldName)) { + deserializedSoftDeleteSettings.enhancedSecurityState + = EnhancedSecurityState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeleteSettings; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteState.java index 3844e162fb759..bfae1785cbb8d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SoftDeleteState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public SoftDeleteState() { * @param name a name to look for. * @return the corresponding SoftDeleteState. */ - @JsonCreator public static SoftDeleteState fromString(String name) { return fromString(name, SoftDeleteState.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/StandardTierStorageRedundancy.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/StandardTierStorageRedundancy.java index d516c13a79691..5f4aea2a4ca5a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/StandardTierStorageRedundancy.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/StandardTierStorageRedundancy.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public StandardTierStorageRedundancy() { * @param name a name to look for. * @return the corresponding StandardTierStorageRedundancy. */ - @JsonCreator public static StandardTierStorageRedundancy fromString(String name) { return fromString(name, StandardTierStorageRedundancy.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java index d5696a6d61821..922d1cd8e80c6 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public TriggerType() { * @param name a name to look for. * @return the corresponding TriggerType. */ - @JsonCreator public static TriggerType fromString(String name) { return fromString(name, TriggerType.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 d24780f59a154..2f0ecaa2d9835 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,66 +5,62 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * Details for upgrading vault. */ @Immutable -public final class UpgradeDetails { +public final class UpgradeDetails implements JsonSerializable { /* * ID of the vault upgrade operation. */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) private String operationId; /* * UTC time at which the upgrade operation has started. */ - @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime startTimeUtc; /* * UTC time at which the upgrade operation status was last updated. */ - @JsonProperty(value = "lastUpdatedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdatedTimeUtc; /* * UTC time at which the upgrade operation has ended. */ - @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime endTimeUtc; /* * Status of the vault upgrade operation. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private VaultUpgradeState status; /* * Message to the user containing information about the upgrade operation. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * The way the vault upgrade was triggered. */ - @JsonProperty(value = "triggerType", access = JsonProperty.Access.WRITE_ONLY) private TriggerType triggerType; /* * Resource ID of the upgraded vault. */ - @JsonProperty(value = "upgradedResourceId", access = JsonProperty.Access.WRITE_ONLY) private String upgradedResourceId; /* * Resource ID of the vault before the upgrade. */ - @JsonProperty(value = "previousResourceId", access = JsonProperty.Access.WRITE_ONLY) private String previousResourceId; /** @@ -161,4 +157,58 @@ public String previousResourceId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpgradeDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UpgradeDetails. + */ + public static UpgradeDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeDetails deserializedUpgradeDetails = new UpgradeDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedUpgradeDetails.operationId = reader.getString(); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedUpgradeDetails.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedTimeUtc".equals(fieldName)) { + deserializedUpgradeDetails.lastUpdatedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedUpgradeDetails.endTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedUpgradeDetails.status = VaultUpgradeState.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedUpgradeDetails.message = reader.getString(); + } else if ("triggerType".equals(fieldName)) { + deserializedUpgradeDetails.triggerType = TriggerType.fromString(reader.getString()); + } else if ("upgradedResourceId".equals(fieldName)) { + deserializedUpgradeDetails.upgradedResourceId = reader.getString(); + } else if ("previousResourceId".equals(fieldName)) { + deserializedUpgradeDetails.previousResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeDetails; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java index c166f7067caaf..518630f54c98d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public UsagesUnit() { * @param name a name to look for. * @return the corresponding UsagesUnit. */ - @JsonCreator public static UsagesUnit fromString(String name) { return fromString(name, UsagesUnit.class); } 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 index d9d000cc3bf8f..c4e38cf39b9a5 100644 --- 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 @@ -5,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A resource identity that is managed by the user of the service. */ @Immutable -public final class UserIdentity { +public final class UserIdentity implements JsonSerializable { /* * 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; /** @@ -55,4 +57,41 @@ public String clientId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserIdentity. + */ + public static UserIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentity deserializedUserIdentity = new UserIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentity; + }); + } } 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 4742cc4113c2b..56c13c0b170d8 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,25 +5,27 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response model for a list of Vaults. */ @Fluent -public final class VaultList { +public final class VaultList implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VaultList. + */ + public static VaultList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultList deserializedVaultList = new VaultList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VaultInner.fromJson(reader1)); + deserializedVaultList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVaultList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultList; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java index 936dc332967bf..fe72e5a0adf03 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public VaultPrivateEndpointState() { * @param name a name to look for. * @return the corresponding VaultPrivateEndpointState. */ - @JsonCreator public static VaultPrivateEndpointState fromString(String name) { return fromString(name, VaultPrivateEndpointState.class); } 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 a973cb0163a76..dbe41aadbf59b 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,114 +5,101 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Properties of the vault. */ @Fluent -public final class VaultProperties { +public final class VaultProperties implements JsonSerializable { /* * Provisioning State. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; /* * Details for upgrading vault. */ - @JsonProperty(value = "upgradeDetails") private UpgradeDetails upgradeDetails; /* * List of private endpoint connection. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /* * Private endpoint state for backup. */ - @JsonProperty(value = "privateEndpointStateForBackup", access = JsonProperty.Access.WRITE_ONLY) private VaultPrivateEndpointState privateEndpointStateForBackup; /* * Private endpoint state for site recovery. */ - @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; /* * property to enable or disable resource provider inbound network traffic from public clients */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * Monitoring Settings of the vault */ - @JsonProperty(value = "monitoringSettings") private MonitoringSettings monitoringSettings; /* * Restore Settings of the vault */ - @JsonProperty(value = "restoreSettings") private RestoreSettings restoreSettings; /* * The redundancy Settings of a Vault */ - @JsonProperty(value = "redundancySettings") private VaultPropertiesRedundancySettings redundancySettings; /* * Security Settings of the vault */ - @JsonProperty(value = "securitySettings") private SecuritySettings securitySettings; /* * Secure Score of Recovery Services Vault */ - @JsonProperty(value = "secureScore", access = JsonProperty.Access.WRITE_ONLY) private SecureScoreLevel secureScore; /* * Security levels of Recovery Services Vault for business continuity and disaster recovery */ - @JsonProperty(value = "bcdrSecurityLevel", access = JsonProperty.Access.WRITE_ONLY) private BcdrSecurityLevel bcdrSecurityLevel; /* * ResourceGuardOperationRequests on which LAC check will be performed */ - @JsonProperty(value = "resourceGuardOperationRequests") private List resourceGuardOperationRequests; /** @@ -409,4 +396,89 @@ public void validate() { securitySettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("upgradeDetails", this.upgradeDetails); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("moveDetails", this.moveDetails); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("monitoringSettings", this.monitoringSettings); + jsonWriter.writeJsonField("restoreSettings", this.restoreSettings); + jsonWriter.writeJsonField("redundancySettings", this.redundancySettings); + jsonWriter.writeJsonField("securitySettings", this.securitySettings); + jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultProperties. + */ + public static VaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultProperties deserializedVaultProperties = new VaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedVaultProperties.provisioningState = reader.getString(); + } else if ("upgradeDetails".equals(fieldName)) { + deserializedVaultProperties.upgradeDetails = UpgradeDetails.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionVaultProperties.fromJson(reader1)); + deserializedVaultProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("privateEndpointStateForBackup".equals(fieldName)) { + deserializedVaultProperties.privateEndpointStateForBackup + = VaultPrivateEndpointState.fromString(reader.getString()); + } else if ("privateEndpointStateForSiteRecovery".equals(fieldName)) { + deserializedVaultProperties.privateEndpointStateForSiteRecovery + = VaultPrivateEndpointState.fromString(reader.getString()); + } else if ("encryption".equals(fieldName)) { + deserializedVaultProperties.encryption = VaultPropertiesEncryption.fromJson(reader); + } else if ("moveDetails".equals(fieldName)) { + deserializedVaultProperties.moveDetails = VaultPropertiesMoveDetails.fromJson(reader); + } else if ("moveState".equals(fieldName)) { + deserializedVaultProperties.moveState = ResourceMoveState.fromString(reader.getString()); + } else if ("backupStorageVersion".equals(fieldName)) { + deserializedVaultProperties.backupStorageVersion + = BackupStorageVersion.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedVaultProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("monitoringSettings".equals(fieldName)) { + deserializedVaultProperties.monitoringSettings = MonitoringSettings.fromJson(reader); + } else if ("restoreSettings".equals(fieldName)) { + deserializedVaultProperties.restoreSettings = RestoreSettings.fromJson(reader); + } else if ("redundancySettings".equals(fieldName)) { + deserializedVaultProperties.redundancySettings = VaultPropertiesRedundancySettings.fromJson(reader); + } else if ("securitySettings".equals(fieldName)) { + deserializedVaultProperties.securitySettings = SecuritySettings.fromJson(reader); + } else if ("secureScore".equals(fieldName)) { + deserializedVaultProperties.secureScore = SecureScoreLevel.fromString(reader.getString()); + } else if ("bcdrSecurityLevel".equals(fieldName)) { + deserializedVaultProperties.bcdrSecurityLevel = BcdrSecurityLevel.fromString(reader.getString()); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedVaultProperties.resourceGuardOperationRequests = resourceGuardOperationRequests; + } else { + reader.skipChildren(); + } + } + + return deserializedVaultProperties; + }); + } } 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 index 6ed7303a8a300..ad3fb17823709 100644 --- 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 @@ -5,29 +5,30 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Customer Managed Key details of the resource. */ @Fluent -public final class VaultPropertiesEncryption { +public final class VaultPropertiesEncryption implements JsonSerializable { /* * 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; /** @@ -110,4 +111,48 @@ public void validate() { kekIdentity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + jsonWriter.writeJsonField("kekIdentity", this.kekIdentity); + jsonWriter.writeStringField("infrastructureEncryption", + this.infrastructureEncryption == null ? null : this.infrastructureEncryption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultPropertiesEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultPropertiesEncryption if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultPropertiesEncryption. + */ + public static VaultPropertiesEncryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultPropertiesEncryption deserializedVaultPropertiesEncryption = new VaultPropertiesEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultProperties".equals(fieldName)) { + deserializedVaultPropertiesEncryption.keyVaultProperties = CmkKeyVaultProperties.fromJson(reader); + } else if ("kekIdentity".equals(fieldName)) { + deserializedVaultPropertiesEncryption.kekIdentity = CmkKekIdentity.fromJson(reader); + } else if ("infrastructureEncryption".equals(fieldName)) { + deserializedVaultPropertiesEncryption.infrastructureEncryption + = InfrastructureEncryptionState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultPropertiesEncryption; + }); + } } 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 index 3832369cf42f8..29155c1f4406a 100644 --- 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 @@ -5,42 +5,42 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * The details of the latest move operation performed on the Azure Resource. */ @Immutable -public final class VaultPropertiesMoveDetails { +public final class VaultPropertiesMoveDetails implements JsonSerializable { /* * 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; /** @@ -101,4 +101,49 @@ public String targetResourceId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultPropertiesMoveDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultPropertiesMoveDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultPropertiesMoveDetails. + */ + public static VaultPropertiesMoveDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultPropertiesMoveDetails deserializedVaultPropertiesMoveDetails = new VaultPropertiesMoveDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedVaultPropertiesMoveDetails.operationId = reader.getString(); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedVaultPropertiesMoveDetails.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completionTimeUtc".equals(fieldName)) { + deserializedVaultPropertiesMoveDetails.completionTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedVaultPropertiesMoveDetails.sourceResourceId = reader.getString(); + } else if ("targetResourceId".equals(fieldName)) { + deserializedVaultPropertiesMoveDetails.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultPropertiesMoveDetails; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesRedundancySettings.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesRedundancySettings.java index d588d9ce655cd..e9e43db64c380 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesRedundancySettings.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPropertiesRedundancySettings.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The redundancy Settings of a Vault. */ @Fluent -public final class VaultPropertiesRedundancySettings { +public final class VaultPropertiesRedundancySettings implements JsonSerializable { /* * The storage redundancy setting of a vault */ - @JsonProperty(value = "standardTierStorageRedundancy") private StandardTierStorageRedundancy standardTierStorageRedundancy; /* * Flag to show if Cross Region Restore is enabled on the Vault or not */ - @JsonProperty(value = "crossRegionRestore") private CrossRegionRestore crossRegionRestore; /** @@ -78,4 +80,48 @@ public VaultPropertiesRedundancySettings withCrossRegionRestore(CrossRegionResto */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("standardTierStorageRedundancy", + this.standardTierStorageRedundancy == null ? null : this.standardTierStorageRedundancy.toString()); + jsonWriter.writeStringField("crossRegionRestore", + this.crossRegionRestore == null ? null : this.crossRegionRestore.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultPropertiesRedundancySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultPropertiesRedundancySettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultPropertiesRedundancySettings. + */ + public static VaultPropertiesRedundancySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultPropertiesRedundancySettings deserializedVaultPropertiesRedundancySettings + = new VaultPropertiesRedundancySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("standardTierStorageRedundancy".equals(fieldName)) { + deserializedVaultPropertiesRedundancySettings.standardTierStorageRedundancy + = StandardTierStorageRedundancy.fromString(reader.getString()); + } else if ("crossRegionRestore".equals(fieldName)) { + deserializedVaultPropertiesRedundancySettings.crossRegionRestore + = CrossRegionRestore.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultPropertiesRedundancySettings; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultSubResourceType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultSubResourceType.java index 98d61ac38467d..64fb989c4ded0 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultSubResourceType.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultSubResourceType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public VaultSubResourceType() { * @param name a name to look for. * @return the corresponding VaultSubResourceType. */ - @JsonCreator public static VaultSubResourceType fromString(String name) { return fromString(name, VaultSubResourceType.class); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java index 2c5df867c952f..202794545de33 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public VaultUpgradeState() { * @param name a name to look for. * @return the corresponding VaultUpgradeState. */ - @JsonCreator public static VaultUpgradeState fromString(String name) { return fromString(name, VaultUpgradeState.class); } 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 b3ac9bf281bc2..53e1d6f0780f6 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,19 +5,22 @@ package com.azure.resourcemanager.recoveryservices.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Usage for vault. */ @Fluent -public final class VaultUsageList { +public final class VaultUsageList implements JsonSerializable { /* * The list of usages for the given vault. */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +59,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultUsageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultUsageList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultUsageList. + */ + public static VaultUsageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultUsageList deserializedVaultUsageList = new VaultUsageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VaultUsageInner.fromJson(reader1)); + deserializedVaultUsageList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVaultUsageList; + }); + } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java index caf0febb7e218..a0662c0879045 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.recoveryservices.fluent.models; exports com.azure.resourcemanager.recoveryservices.models; - opens com.azure.resourcemanager.recoveryservices.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.recoveryservices.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.recoveryservices.fluent.models to com.azure.core; + opens com.azure.resourcemanager.recoveryservices.models to com.azure.core; } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/proxy-config.json b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/proxy-config.json index 285108cf6112b..431bd0f693944 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/proxy-config.json +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.recoveryservices.implementation.VaultCertificatesClientImpl$VaultCertificatesService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.RegisteredIdentitiesClientImpl$RegisteredIdentitiesService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.ReplicationUsagesClientImpl$ReplicationUsagesService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.PrivateLinkResourcesOperationsClientImpl$PrivateLinkResourcesOperationsService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.RecoveryServicesClientImpl$RecoveryServicesService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.VaultsClientImpl$VaultsService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.VaultExtendedInfoesClientImpl$VaultExtendedInfoesService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.recoveryservices.implementation.UsagesClientImpl$UsagesService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.recoveryservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.recoveryservices.implementation.PrivateLinkResourcesOperationsClientImpl$PrivateLinkResourcesOperationsService"],["com.azure.resourcemanager.recoveryservices.implementation.RecoveryServicesClientImpl$RecoveryServicesService"],["com.azure.resourcemanager.recoveryservices.implementation.RegisteredIdentitiesClientImpl$RegisteredIdentitiesService"],["com.azure.resourcemanager.recoveryservices.implementation.ReplicationUsagesClientImpl$ReplicationUsagesService"],["com.azure.resourcemanager.recoveryservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.recoveryservices.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.recoveryservices.implementation.VaultCertificatesClientImpl$VaultCertificatesService"],["com.azure.resourcemanager.recoveryservices.implementation.VaultExtendedInfoesClientImpl$VaultExtendedInfoesService"],["com.azure.resourcemanager.recoveryservices.implementation.VaultsClientImpl$VaultsService"]] \ No newline at end of file diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/reflect-config.json b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/reflect-config.json index 4b5227d25b156..0637a088a01e8 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/reflect-config.json +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservices/reflect-config.json @@ -1,421 +1 @@ -[ { - "name" : "com.azure.resourcemanager.recoveryservices.models.CertificateRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.RawCertificateData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceCertificateDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ReplicationUsageList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.MonitoringSummary", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.JobsSummary", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateLinkResources", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceCapabilities", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CapabilitiesProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.DnsZone", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceCapabilitiesBase", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.CapabilitiesResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CapabilitiesResponseProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.DnsZoneResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.IdentityData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.UserIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.UpgradeDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateEndpointConnectionVaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateEndpointConnection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateLinkServiceConnectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultPropertiesMoveDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.MonitoringSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.AzureMonitorAlertSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClassicAlertSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.RestoreSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CrossSubscriptionRestoreSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultPropertiesRedundancySettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.SecuritySettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ImmutabilitySettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.SoftDeleteSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.Sku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForServiceSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForLogSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PatchVault", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PatchTrackedResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultUsageList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.NameInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceCertificateAndAadDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceCertificateAndAcsDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.AuthType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultSubResourceType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultUpgradeState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.TriggerType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PrivateEndpointConnectionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.VaultPrivateEndpointState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ResourceMoveState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.BackupStorageVersion", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.AlertsState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CrossSubscriptionRestoreState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.StandardTierStorageRedundancy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.CrossRegionRestore", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.ImmutabilityState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.SoftDeleteState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.EnhancedSecurityState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.MultiUserAuthorization", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.SecureScoreLevel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.BcdrSecurityLevel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.SkuName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.recoveryservices.models.UsagesUnit", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file 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 index f9d02da967abf..b3b1c6ca624d0 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListOperations.json */ /** * Sample code: ListOperations. 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 index 8d23973103566..0cac78df3e13c 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class PrivateLinkResourcesOperationGetSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetPrivateLinkResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetPrivateLinkResources.json */ /** * Sample code: Get PrivateLinkResource. 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 index 90600aa67ae56..397f9fdcd56a3 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class PrivateLinkResourcesOperationListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListPrivateLinkResources.json */ /** * Sample code: List PrivateLinkResources. diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesSamples.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesSamples.java index ecaee3ab6c866..e51e33627c022 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesSamples.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/samples/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesSamples.java @@ -15,7 +15,9 @@ */ public final class RecoveryServicesCapabilitiesSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Capabilities.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * Capabilities.json */ /** * Sample code: Capabilities for Microsoft.RecoveryServices/Vaults. 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 index 993c13e0c140d..bfb4c60f88b54 100644 --- 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 @@ -11,7 +11,9 @@ */ public final class RecoveryServicesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_Available.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * CheckNameAvailability_Available.json */ /** * Sample code: Availability status of Resource Name when no resource with same name, type and subscription exists, @@ -30,7 +32,9 @@ public final class RecoveryServicesCheckNameAvailabilitySamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_NotAvailable.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * CheckNameAvailability_NotAvailable.json */ /** * Sample code: Availability status of Resource Name when resource with same name, type and subscription exists. 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 index d62ba356e3d72..c9fec89296f71 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class RegisteredIdentitiesDeleteSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteRegisteredIdentities.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * DeleteRegisteredIdentities.json */ /** * Sample code: Delete registered Identity. 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 index c2572750a7395..d36006b45fb2c 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class ReplicationUsagesListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListReplicationUsages.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListReplicationUsages.json */ /** * Sample code: Gets Replication usages of vault. 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 index 691a538deff56..37cfd137106c6 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class ResourceProviderGetOperationResultSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationResult.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetOperationResult.json */ /** * Sample code: Get Operation Result. 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 index d780342df5eaa..c240a8005bb7b 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class ResourceProviderGetOperationStatusSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationStatus.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GetOperationStatus.json */ /** * Sample code: Get Operation Status. 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 index a17a4700d8c0b..f89911afd4945 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class UsagesListByVaultsSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListUsages.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListUsages. + * json */ /** * Sample code: Gets vault usages. 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 index 0f9f9ab245b44..1a9eddede84a5 100644 --- 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 @@ -12,7 +12,9 @@ */ public final class VaultCertificatesCreateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVaultCred.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVaultCred.json */ /** * Sample code: Download vault credential file. 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 index 4d8c626d3c072..6da74d5e43071 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultExtendedInfoCreateOrUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/UpdateVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * UpdateVaultExtendedInfo.json */ /** * Sample code: Put ExtendedInfo of Resource. 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 index abe7663f625a8..06578503f56e4 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultExtendedInfoGetSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * GETVaultExtendedInfo.json */ /** * Sample code: Get ExtendedInfo of Resource. 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 index 530d6a4ebe8b4..7afbf71901d0b 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultExtendedInfoUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/UpdateVaultExtendedInfo.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * UpdateVaultExtendedInfo.json */ /** * Sample code: PATCH ExtendedInfo of Resource. 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 index 2a983b0d25a26..837c3373e606a 100644 --- 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 @@ -31,7 +31,9 @@ */ public final class VaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithCMK.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithCMK.json */ /** * Sample code: Create or Update Vault with CustomerManagedKeys. @@ -59,7 +61,9 @@ public static void createOrUpdateVaultWithCustomerManagedKeys( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault. + * json */ /** * Sample code: Create or Update Recovery Services vault. @@ -79,7 +83,9 @@ public static void createOrUpdateRecoveryServicesVault( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_ResourceGuardEnabled.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_ResourceGuardEnabled.json */ /** * Sample code: Create or Update Vault performing critical operation With MUA. @@ -109,7 +115,9 @@ public static void createOrUpdateVaultPerformingCriticalOperationWithMUA( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithUserAssignedIdentity.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithUserAssignedIdentity.json */ /** * Sample code: Create or Update Vault with User Assigned Identity. @@ -132,7 +140,9 @@ public static void createOrUpdateVaultWithUserAssignedIdentity( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithMonitoringSettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithMonitoringSettings.json */ /** * Sample code: Create or Update Vault With Monitoring Setting. @@ -160,7 +170,9 @@ public static void createOrUpdateVaultWithMonitoringSetting( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithRedundancySettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PUTVault_WithRedundancySettings.json */ /** * Sample code: Create or Update Vault With Redundancy Setting. 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 index ec53d0983c988..31e81629d1c07 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultsDeleteSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteVault + * .json */ /** * Sample code: Delete Recovery Services Vault. 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 index 9e8b32c11e9f5..6d9bc134a9240 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVault. + * json */ /** * Sample code: Get Recovery Services Resource. 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 index 3fa9215cbee0f..69fb7bb7119de 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListResources.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListResources.json */ /** * Sample code: List of Recovery Services Resources in ResourceGroup. 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 index 868a4008ba1c6..daccdbc48ea5a 100644 --- 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 @@ -9,7 +9,9 @@ */ public final class VaultsListSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListBySubscriptionIds.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * ListBySubscriptionIds.json */ /** * Sample code: List of Recovery Services Resources in SubscriptionId. 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 index fcc2bcf88b68f..b87f0110e784c 100644 --- 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 @@ -28,7 +28,9 @@ */ public final class VaultsUpdateSamples { /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithMonitoringSettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithMonitoringSettings.json */ /** * Sample code: Update Vault With Monitoring Setting. @@ -54,7 +56,9 @@ public final class VaultsUpdateSamples { } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithCMK.json */ /** * Sample code: Update Resource With CustomerManagedKeys. @@ -81,7 +85,9 @@ public static void updateResourceWithCustomerManagedKeys( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PatchVault_WithCMK2.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PatchVault_WithCMK2.json */ /** * Sample code: Update Resource With CustomerManagedKeys2. @@ -102,7 +108,9 @@ public static void updateResourceWithCustomerManagedKeys2( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK3.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithCMK3.json */ /** * Sample code: Update Resource With CustomerManagedKeys3. @@ -126,7 +134,9 @@ public static void updateResourceWithCustomerManagedKeys3( } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault. + * json */ /** * Sample code: Update Resource. @@ -141,7 +151,9 @@ public static void updateResource(com.azure.resourcemanager.recoveryservices.Rec } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithRedundancySettings.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithRedundancySettings.json */ /** * Sample code: Update Vault With Redundancy Setting. @@ -161,7 +173,9 @@ public static void updateResource(com.azure.resourcemanager.recoveryservices.Rec } /* - * x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithUserAssignedIdentity.json + * x-ms-original-file: + * specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ + * PATCHVault_WithUserAssignedIdentity.json */ /** * Sample code: Update Resource With User Assigned Identity. diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/NameInfoTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/NameInfoTests.java index 1e5f4bf9eb023..96f34607a5dfa 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/NameInfoTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/NameInfoTests.java @@ -11,17 +11,17 @@ public final class NameInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NameInfo model = BinaryData.fromString("{\"value\":\"cjooxdjebwpucwwf\",\"localizedValue\":\"vbvmeu\"}") + NameInfo model = BinaryData.fromString("{\"value\":\"vljua\",\"localizedValue\":\"quhcdhmduala\"}") .toObject(NameInfo.class); - Assertions.assertEquals("cjooxdjebwpucwwf", model.value()); - Assertions.assertEquals("vbvmeu", model.localizedValue()); + Assertions.assertEquals("vljua", model.value()); + Assertions.assertEquals("quhcdhmduala", model.localizedValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameInfo model = new NameInfo().withValue("cjooxdjebwpucwwf").withLocalizedValue("vbvmeu"); + NameInfo model = new NameInfo().withValue("vljua").withLocalizedValue("quhcdhmduala"); model = BinaryData.fromObject(model).toObject(NameInfo.class); - Assertions.assertEquals("cjooxdjebwpucwwf", model.value()); - Assertions.assertEquals("vbvmeu", model.localizedValue()); + Assertions.assertEquals("vljua", model.value()); + Assertions.assertEquals("quhcdhmduala", model.localizedValue()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationResourceInnerTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationResourceInnerTests.java deleted file mode 100644 index 8869c562b0df1..0000000000000 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationResourceInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.recoveryservices.fluent.models.OperationResourceInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class OperationResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResourceInner model = BinaryData.fromString( - "{\"endTime\":\"2021-02-11T06:40:02Z\",\"id\":\"tlmoyrx\",\"name\":\"fudwpznt\",\"status\":\"dzhlrq\",\"startTime\":\"2021-03-06T10:40:17Z\"}") - .toObject(OperationResourceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T06:40:02Z"), model.endTime()); - Assertions.assertEquals("tlmoyrx", model.id()); - Assertions.assertEquals("fudwpznt", model.name()); - Assertions.assertEquals("dzhlrq", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T10:40:17Z"), model.startTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResourceInner model - = new OperationResourceInner().withEndTime(OffsetDateTime.parse("2021-02-11T06:40:02Z")) - .withId("tlmoyrx") - .withName("fudwpznt") - .withStatus("dzhlrq") - .withStartTime(OffsetDateTime.parse("2021-03-06T10:40:17Z")); - model = BinaryData.fromObject(model).toObject(OperationResourceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T06:40:02Z"), model.endTime()); - Assertions.assertEquals("tlmoyrx", model.id()); - Assertions.assertEquals("fudwpznt", model.name()); - Assertions.assertEquals("dzhlrq", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T10:40:17Z"), model.startTime()); - } -} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListMockTests.java index d6423365692e7..3b95797fa7cce 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/OperationsListMockTests.java @@ -22,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"oadsuvar\",\"display\":{\"provider\":\"dmjsjqb\",\"resource\":\"hyxxrwlycoduhpk\",\"operation\":\"gymare\",\"description\":\"ajxq\"},\"origin\":\"jhkycub\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"ofwq\",\"displayName\":\"qal\",\"blobDuration\":\"mnjijpxacqqudf\"},{\"name\":\"yxbaaabjyvayf\",\"displayName\":\"m\",\"blobDuration\":\"rtuzqogs\"},{\"name\":\"nevfdnw\",\"displayName\":\"mewzsyyc\",\"blobDuration\":\"zsoibjudpfrxtr\"}]}}}]}"; + = "{\"value\":[{\"name\":\"tlwwrlk\",\"display\":{\"provider\":\"ncvokotllxdyhg\",\"resource\":\"ocogj\",\"operation\":\"dtbnnha\",\"description\":\"ocrkvcikh\"},\"origin\":\"p\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"queziky\",\"displayName\":\"gxk\",\"blobDuration\":\"la\"}]}}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,17 +34,17 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("oadsuvar", response.iterator().next().name()); - Assertions.assertEquals("dmjsjqb", response.iterator().next().display().provider()); - Assertions.assertEquals("hyxxrwlycoduhpk", response.iterator().next().display().resource()); - Assertions.assertEquals("gymare", response.iterator().next().display().operation()); - Assertions.assertEquals("ajxq", response.iterator().next().display().description()); - Assertions.assertEquals("jhkycub", response.iterator().next().origin()); - Assertions.assertEquals("ofwq", + Assertions.assertEquals("tlwwrlk", response.iterator().next().name()); + Assertions.assertEquals("ncvokotllxdyhg", response.iterator().next().display().provider()); + Assertions.assertEquals("ocogj", response.iterator().next().display().resource()); + Assertions.assertEquals("dtbnnha", response.iterator().next().display().operation()); + Assertions.assertEquals("ocrkvcikh", response.iterator().next().display().description()); + Assertions.assertEquals("p", response.iterator().next().origin()); + Assertions.assertEquals("queziky", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("qal", + Assertions.assertEquals("gxk", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("mnjijpxacqqudf", + Assertions.assertEquals("la", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).blobDuration()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java index 2475b1893a4e5..30b420570c717 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class PrivateLinkResourcesOperationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"oellwp\",\"requiredMembers\":[\"ygpfqb\"],\"requiredZoneNames\":[\"eopzfqrhhuaopp\",\"cq\",\"qxolzdahzx\",\"t\"]},\"id\":\"gbkdmoizpos\",\"name\":\"grcfb\",\"type\":\"rmfqjhhkxbpvj\"}"; + = "{\"properties\":{\"groupId\":\"xznelixhnrztf\",\"requiredMembers\":[\"bnxknalaulppg\"],\"requiredZoneNames\":[\"pnapnyiropuh\",\"igvpgylg\",\"git\",\"medjvcslynqwwncw\"]},\"id\":\"hxg\",\"name\":\"rmgucnap\",\"type\":\"eoellwptfdygp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +30,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PrivateLinkResource response = manager.privateLinkResourcesOperations() - .getWithResponse("gylgqgitxmedjvcs", "ynqwwncwzzhxgk", "rmgucnap", com.azure.core.util.Context.NONE) + .getWithResponse("n", "ixisxyawjoy", "qcslyjpkiid", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsListMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsListMockTests.java index 08723fe5c9b4c..d3d0038aff16e 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsListMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/PrivateLinkResourcesOperationsListMockTests.java @@ -21,7 +21,7 @@ public final class PrivateLinkResourcesOperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"xisxyawjoyaqcsl\",\"requiredMembers\":[\"kiidzyex\"],\"requiredZoneNames\":[\"lixhnrztfol\"]},\"id\":\"nxknalaulp\",\"name\":\"gdtpnapnyiro\",\"type\":\"hpigv\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"bbtdzumvee\",\"requiredMembers\":[\"wozuhkf\"],\"requiredZoneNames\":[\"jyofdxluusdtto\",\"waboe\"]},\"id\":\"v\",\"name\":\"lns\",\"type\":\"bxwyjsflhhcaa\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,7 +31,7 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.privateLinkResourcesOperations().list("nsmvbxwyj", "flhhcaal", com.azure.core.util.Context.NONE); + = manager.privateLinkResourcesOperations().list("e", "xdult", com.azure.core.util.Context.NONE); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesWithResponseMockTests.java index 4d3c4fbb24224..389787fa66c45 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesWithResponseMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCapabilitiesWithResponseMockTests.java @@ -26,7 +26,7 @@ public final class RecoveryServicesCapabilitiesWithResponseMockTests { @Test public void testCapabilitiesWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dnsZones\":[{\"requiredZoneNames\":[\"vrnsvshqjohxc\",\"sbfov\",\"srruvwbhsqfsubcg\",\"birx\"],\"subResource\":\"AzureSiteRecovery\"},{\"requiredZoneNames\":[\"rfbjf\",\"twss\",\"t\"],\"subResource\":\"AzureSiteRecovery\"},{\"requiredZoneNames\":[\"zbexilzznfqqnvw\",\"mqtaruoujmkcjh\",\"qytjrybnwjewgd\"],\"subResource\":\"AzureBackup_secondary\"}]},\"type\":\"rvnaenqpeh\"}"; + = "{\"properties\":{\"dnsZones\":[{\"requiredZoneNames\":[\"wbxqzvszjfau\",\"j\"],\"subResource\":\"AzureSiteRecovery\"}]},\"type\":\"xivetvt\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,16 +36,19 @@ public void testCapabilitiesWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); CapabilitiesResponse response = manager.recoveryServices() - .capabilitiesWithResponse("bhsfxob", - new ResourceCapabilities().withType("mpew") + .capabilitiesWithResponse("zpostmgrcfbu", + new ResourceCapabilities().withType("vjymjhxxjyngud") .withProperties(new CapabilitiesProperties().withDnsZones( - Arrays.asList(new DnsZone().withSubResource(VaultSubResourceType.AZURE_SITE_RECOVERY)))), + Arrays.asList(new DnsZone().withSubResource(VaultSubResourceType.AZURE_BACKUP_SECONDARY), + new DnsZone().withSubResource(VaultSubResourceType.AZURE_SITE_RECOVERY), + new DnsZone().withSubResource(VaultSubResourceType.AZURE_BACKUP), + new DnsZone().withSubResource(VaultSubResourceType.AZURE_BACKUP)))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rvnaenqpeh", response.type()); + Assertions.assertEquals("xivetvt", response.type()); Assertions.assertEquals(VaultSubResourceType.AZURE_SITE_RECOVERY, response.properties().dnsZones().get(0).subResource()); - Assertions.assertEquals("vrnsvshqjohxc", response.properties().dnsZones().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("wbxqzvszjfau", response.properties().dnsZones().get(0).requiredZoneNames().get(0)); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilityWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilityWithResponseMockTests.java index c2ad3a1a2e5e7..665b25ea61a55 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RecoveryServicesCheckNameAvailabilityWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class RecoveryServicesCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"fdxxivetvtcqaqtd\",\"message\":\"mcbxvwvxysl\"}"; + String responseStr = "{\"nameAvailable\":false,\"reason\":\"xcto\",\"message\":\"bkdmo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,12 @@ public void testCheckNameAvailabilityWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); CheckNameAvailabilityResult response = manager.recoveryServices() - .checkNameAvailabilityWithResponse("mjh", "xjyngudivk", - new CheckNameAvailabilityParameters().withType("swbxqz").withName("zjf"), - com.azure.core.util.Context.NONE) + .checkNameAvailabilityWithResponse("qbuaceopzfqr", "huaoppp", + new CheckNameAvailabilityParameters().withType("eqx").withName("z"), com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("fdxxivetvtcqaqtd", response.reason()); - Assertions.assertEquals("mcbxvwvxysl", response.message()); + Assertions.assertEquals("xcto", response.reason()); + Assertions.assertEquals("bkdmo", response.message()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteWithResponseMockTests.java index f9d7cc4adfd28..e1642627e1f37 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteWithResponseMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/RegisteredIdentitiesDeleteWithResponseMockTests.java @@ -27,7 +27,8 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.registeredIdentities().deleteWithResponse("pjzu", "e", "xdult", com.azure.core.util.Context.NONE); + manager.registeredIdentities() + .deleteWithResponse("bycnojvkn", "e", "qsgzvahapj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListMockTests.java index bd3a8ec90c6ef..09e3ee1e8d519 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ReplicationUsagesListMockTests.java @@ -22,7 +22,7 @@ public final class ReplicationUsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"monitoringSummary\":{\"unHealthyVmCount\":1369679233,\"unHealthyProviderCount\":657936288,\"eventsCount\":1295774959,\"deprecatedProviderCount\":568244971,\"supportedProviderCount\":301470768,\"unsupportedProviderCount\":2103564853},\"jobsSummary\":{\"failedJobs\":1422945070,\"suspendedJobs\":1252528512,\"inProgressJobs\":45872869},\"protectedItemCount\":1947792369,\"recoveryPlanCount\":2085364549,\"registeredServersCount\":1408217063,\"recoveryServicesProviderAuthType\":628545796}]}"; + = "{\"value\":[{\"monitoringSummary\":{\"unHealthyVmCount\":977455104,\"unHealthyProviderCount\":1700948230,\"eventsCount\":150057855,\"deprecatedProviderCount\":1168094954,\"supportedProviderCount\":1486439488,\"unsupportedProviderCount\":1146860274},\"jobsSummary\":{\"failedJobs\":1845273018,\"suspendedJobs\":1427151650,\"inProgressJobs\":1539688741},\"protectedItemCount\":1381337865,\"recoveryPlanCount\":1073043267,\"registeredServersCount\":1819249918,\"recoveryServicesProviderAuthType\":1074564233}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,20 +32,20 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.replicationUsages().list("kzbbtd", "umveekgpwozuhkf", com.azure.core.util.Context.NONE); + = manager.replicationUsages().list("zhpvgqzcjrvxd", "zlmwlxkvugfhz", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1369679233, response.iterator().next().monitoringSummary().unHealthyVmCount()); - Assertions.assertEquals(657936288, response.iterator().next().monitoringSummary().unHealthyProviderCount()); - Assertions.assertEquals(1295774959, response.iterator().next().monitoringSummary().eventsCount()); - Assertions.assertEquals(568244971, response.iterator().next().monitoringSummary().deprecatedProviderCount()); - Assertions.assertEquals(301470768, response.iterator().next().monitoringSummary().supportedProviderCount()); - Assertions.assertEquals(2103564853, response.iterator().next().monitoringSummary().unsupportedProviderCount()); - Assertions.assertEquals(1422945070, response.iterator().next().jobsSummary().failedJobs()); - Assertions.assertEquals(1252528512, response.iterator().next().jobsSummary().suspendedJobs()); - Assertions.assertEquals(45872869, response.iterator().next().jobsSummary().inProgressJobs()); - Assertions.assertEquals(1947792369, response.iterator().next().protectedItemCount()); - Assertions.assertEquals(2085364549, response.iterator().next().recoveryPlanCount()); - Assertions.assertEquals(1408217063, response.iterator().next().registeredServersCount()); - Assertions.assertEquals(628545796, response.iterator().next().recoveryServicesProviderAuthType()); + Assertions.assertEquals(977455104, response.iterator().next().monitoringSummary().unHealthyVmCount()); + Assertions.assertEquals(1700948230, response.iterator().next().monitoringSummary().unHealthyProviderCount()); + Assertions.assertEquals(150057855, response.iterator().next().monitoringSummary().eventsCount()); + Assertions.assertEquals(1168094954, response.iterator().next().monitoringSummary().deprecatedProviderCount()); + Assertions.assertEquals(1486439488, response.iterator().next().monitoringSummary().supportedProviderCount()); + Assertions.assertEquals(1146860274, response.iterator().next().monitoringSummary().unsupportedProviderCount()); + Assertions.assertEquals(1845273018, response.iterator().next().jobsSummary().failedJobs()); + Assertions.assertEquals(1427151650, response.iterator().next().jobsSummary().suspendedJobs()); + Assertions.assertEquals(1539688741, response.iterator().next().jobsSummary().inProgressJobs()); + Assertions.assertEquals(1381337865, response.iterator().next().protectedItemCount()); + Assertions.assertEquals(1073043267, response.iterator().next().recoveryPlanCount()); + Assertions.assertEquals(1819249918, response.iterator().next().registeredServersCount()); + Assertions.assertEquals(1074564233, response.iterator().next().recoveryServicesProviderAuthType()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAadDetailsTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAadDetailsTests.java index 2d63f2e8b2f12..e208518460e8d 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAadDetailsTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAadDetailsTests.java @@ -13,54 +13,55 @@ public final class ResourceCertificateAndAadDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceCertificateAndAadDetails model = BinaryData.fromString( - "{\"authType\":\"AzureActiveDirectory\",\"aadAuthority\":\"civyhzceuo\",\"aadTenantId\":\"gjrwjueiotwmcdyt\",\"servicePrincipalClientId\":\"x\",\"servicePrincipalObjectId\":\"it\",\"azureManagementEndpointAudience\":\"nrjawgqwg\",\"serviceResourceId\":\"ni\",\"aadAudience\":\"x\",\"friendlyName\":\"py\",\"issuer\":\"klwndnhjdauwhv\",\"resourceId\":8550144632866513257,\"subject\":\"tdhxujznbmpowuwp\",\"thumbprint\":\"qlveualupjmkh\",\"validFrom\":\"2021-08-19T13:39:55Z\",\"validTo\":\"2021-03-15T14:14:57Z\"}") + "{\"authType\":\"AzureActiveDirectory\",\"aadAuthority\":\"xqpvfadmw\",\"aadTenantId\":\"rcrgvx\",\"servicePrincipalClientId\":\"vgomz\",\"servicePrincipalObjectId\":\"fmisg\",\"azureManagementEndpointAudience\":\"bnbbeldawkz\",\"serviceResourceId\":\"liourqhak\",\"aadAudience\":\"hashsfwxosow\",\"friendlyName\":\"ugicjooxdjebw\",\"issuer\":\"cwwfvovbvme\",\"resourceId\":1380137712554146124,\"subject\":\"yhz\",\"thumbprint\":\"uojgj\",\"validFrom\":\"2021-01-13T06:34:52Z\",\"validTo\":\"2021-01-11T08:00:10Z\"}") .toObject(ResourceCertificateAndAadDetails.class); - Assertions.assertEquals("py", model.friendlyName()); - Assertions.assertEquals("klwndnhjdauwhv", model.issuer()); - Assertions.assertEquals(8550144632866513257L, model.resourceId()); - Assertions.assertEquals("tdhxujznbmpowuwp", model.subject()); - Assertions.assertEquals("qlveualupjmkh", model.thumbprint()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T13:39:55Z"), model.validFrom()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T14:14:57Z"), model.validTo()); - Assertions.assertEquals("civyhzceuo", model.aadAuthority()); - Assertions.assertEquals("gjrwjueiotwmcdyt", model.aadTenantId()); - Assertions.assertEquals("x", model.servicePrincipalClientId()); - Assertions.assertEquals("it", model.servicePrincipalObjectId()); - Assertions.assertEquals("nrjawgqwg", model.azureManagementEndpointAudience()); - Assertions.assertEquals("ni", model.serviceResourceId()); - Assertions.assertEquals("x", model.aadAudience()); + Assertions.assertEquals("ugicjooxdjebw", model.friendlyName()); + Assertions.assertEquals("cwwfvovbvme", model.issuer()); + Assertions.assertEquals(1380137712554146124L, model.resourceId()); + Assertions.assertEquals("yhz", model.subject()); + Assertions.assertEquals("uojgj", model.thumbprint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T06:34:52Z"), model.validFrom()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T08:00:10Z"), model.validTo()); + Assertions.assertEquals("xqpvfadmw", model.aadAuthority()); + Assertions.assertEquals("rcrgvx", model.aadTenantId()); + Assertions.assertEquals("vgomz", model.servicePrincipalClientId()); + Assertions.assertEquals("fmisg", model.servicePrincipalObjectId()); + Assertions.assertEquals("bnbbeldawkz", model.azureManagementEndpointAudience()); + Assertions.assertEquals("liourqhak", model.serviceResourceId()); + Assertions.assertEquals("hashsfwxosow", model.aadAudience()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceCertificateAndAadDetails model = new ResourceCertificateAndAadDetails().withFriendlyName("py") - .withIssuer("klwndnhjdauwhv") - .withResourceId(8550144632866513257L) - .withSubject("tdhxujznbmpowuwp") - .withThumbprint("qlveualupjmkh") - .withValidFrom(OffsetDateTime.parse("2021-08-19T13:39:55Z")) - .withValidTo(OffsetDateTime.parse("2021-03-15T14:14:57Z")) - .withAadAuthority("civyhzceuo") - .withAadTenantId("gjrwjueiotwmcdyt") - .withServicePrincipalClientId("x") - .withServicePrincipalObjectId("it") - .withAzureManagementEndpointAudience("nrjawgqwg") - .withServiceResourceId("ni") - .withAadAudience("x"); + ResourceCertificateAndAadDetails model + = new ResourceCertificateAndAadDetails().withFriendlyName("ugicjooxdjebw") + .withIssuer("cwwfvovbvme") + .withResourceId(1380137712554146124L) + .withSubject("yhz") + .withThumbprint("uojgj") + .withValidFrom(OffsetDateTime.parse("2021-01-13T06:34:52Z")) + .withValidTo(OffsetDateTime.parse("2021-01-11T08:00:10Z")) + .withAadAuthority("xqpvfadmw") + .withAadTenantId("rcrgvx") + .withServicePrincipalClientId("vgomz") + .withServicePrincipalObjectId("fmisg") + .withAzureManagementEndpointAudience("bnbbeldawkz") + .withServiceResourceId("liourqhak") + .withAadAudience("hashsfwxosow"); model = BinaryData.fromObject(model).toObject(ResourceCertificateAndAadDetails.class); - Assertions.assertEquals("py", model.friendlyName()); - Assertions.assertEquals("klwndnhjdauwhv", model.issuer()); - Assertions.assertEquals(8550144632866513257L, model.resourceId()); - Assertions.assertEquals("tdhxujznbmpowuwp", model.subject()); - Assertions.assertEquals("qlveualupjmkh", model.thumbprint()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T13:39:55Z"), model.validFrom()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T14:14:57Z"), model.validTo()); - Assertions.assertEquals("civyhzceuo", model.aadAuthority()); - Assertions.assertEquals("gjrwjueiotwmcdyt", model.aadTenantId()); - Assertions.assertEquals("x", model.servicePrincipalClientId()); - Assertions.assertEquals("it", model.servicePrincipalObjectId()); - Assertions.assertEquals("nrjawgqwg", model.azureManagementEndpointAudience()); - Assertions.assertEquals("ni", model.serviceResourceId()); - Assertions.assertEquals("x", model.aadAudience()); + Assertions.assertEquals("ugicjooxdjebw", model.friendlyName()); + Assertions.assertEquals("cwwfvovbvme", model.issuer()); + Assertions.assertEquals(1380137712554146124L, model.resourceId()); + Assertions.assertEquals("yhz", model.subject()); + Assertions.assertEquals("uojgj", model.thumbprint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T06:34:52Z"), model.validFrom()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T08:00:10Z"), model.validTo()); + Assertions.assertEquals("xqpvfadmw", model.aadAuthority()); + Assertions.assertEquals("rcrgvx", model.aadTenantId()); + Assertions.assertEquals("vgomz", model.servicePrincipalClientId()); + Assertions.assertEquals("fmisg", model.servicePrincipalObjectId()); + Assertions.assertEquals("bnbbeldawkz", model.azureManagementEndpointAudience()); + Assertions.assertEquals("liourqhak", model.serviceResourceId()); + Assertions.assertEquals("hashsfwxosow", model.aadAudience()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAcsDetailsTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAcsDetailsTests.java index 5934b2e66da5f..8810fd02aad2a 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAcsDetailsTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceCertificateAndAcsDetailsTests.java @@ -13,43 +13,42 @@ public final class ResourceCertificateAndAcsDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceCertificateAndAcsDetails model = BinaryData.fromString( - "{\"authType\":\"AccessControlService\",\"globalAcsNamespace\":\"cswsrtjri\",\"globalAcsHostName\":\"lrbpbewtghfgbl\",\"globalAcsRPRealm\":\"gw\",\"friendlyName\":\"lvqhjkbegibtnmx\",\"issuer\":\"bwwaloa\",\"resourceId\":831563566329829657,\"subject\":\"rtzju\",\"thumbprint\":\"wyzmhtxon\",\"validFrom\":\"2021-08-29T11:45:06Z\",\"validTo\":\"2021-04-24T14:23:48Z\"}") + "{\"authType\":\"AccessControlService\",\"globalAcsNamespace\":\"iotwmcdytdxwit\",\"globalAcsHostName\":\"nrjawgqwg\",\"globalAcsRPRealm\":\"hniskxfbkpyc\",\"friendlyName\":\"wndnhj\",\"issuer\":\"uwhvylwzbtdhxujz\",\"resourceId\":9120098526772116433,\"subject\":\"wuwprzqlv\",\"thumbprint\":\"alupjm\",\"validFrom\":\"2021-08-12T08:43:21Z\",\"validTo\":\"2021-08-19T13:39:55Z\"}") .toObject(ResourceCertificateAndAcsDetails.class); - Assertions.assertEquals("lvqhjkbegibtnmx", model.friendlyName()); - Assertions.assertEquals("bwwaloa", model.issuer()); - Assertions.assertEquals(831563566329829657L, model.resourceId()); - Assertions.assertEquals("rtzju", model.subject()); - Assertions.assertEquals("wyzmhtxon", model.thumbprint()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T11:45:06Z"), model.validFrom()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T14:23:48Z"), model.validTo()); - Assertions.assertEquals("cswsrtjri", model.globalAcsNamespace()); - Assertions.assertEquals("lrbpbewtghfgbl", model.globalAcsHostname()); - Assertions.assertEquals("gw", model.globalAcsRPRealm()); + Assertions.assertEquals("wndnhj", model.friendlyName()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.issuer()); + Assertions.assertEquals(9120098526772116433L, model.resourceId()); + Assertions.assertEquals("wuwprzqlv", model.subject()); + Assertions.assertEquals("alupjm", model.thumbprint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T08:43:21Z"), model.validFrom()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T13:39:55Z"), model.validTo()); + Assertions.assertEquals("iotwmcdytdxwit", model.globalAcsNamespace()); + Assertions.assertEquals("nrjawgqwg", model.globalAcsHostname()); + Assertions.assertEquals("hniskxfbkpyc", model.globalAcsRPRealm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceCertificateAndAcsDetails model - = new ResourceCertificateAndAcsDetails().withFriendlyName("lvqhjkbegibtnmx") - .withIssuer("bwwaloa") - .withResourceId(831563566329829657L) - .withSubject("rtzju") - .withThumbprint("wyzmhtxon") - .withValidFrom(OffsetDateTime.parse("2021-08-29T11:45:06Z")) - .withValidTo(OffsetDateTime.parse("2021-04-24T14:23:48Z")) - .withGlobalAcsNamespace("cswsrtjri") - .withGlobalAcsHostname("lrbpbewtghfgbl") - .withGlobalAcsRPRealm("gw"); + ResourceCertificateAndAcsDetails model = new ResourceCertificateAndAcsDetails().withFriendlyName("wndnhj") + .withIssuer("uwhvylwzbtdhxujz") + .withResourceId(9120098526772116433L) + .withSubject("wuwprzqlv") + .withThumbprint("alupjm") + .withValidFrom(OffsetDateTime.parse("2021-08-12T08:43:21Z")) + .withValidTo(OffsetDateTime.parse("2021-08-19T13:39:55Z")) + .withGlobalAcsNamespace("iotwmcdytdxwit") + .withGlobalAcsHostname("nrjawgqwg") + .withGlobalAcsRPRealm("hniskxfbkpyc"); model = BinaryData.fromObject(model).toObject(ResourceCertificateAndAcsDetails.class); - Assertions.assertEquals("lvqhjkbegibtnmx", model.friendlyName()); - Assertions.assertEquals("bwwaloa", model.issuer()); - Assertions.assertEquals(831563566329829657L, model.resourceId()); - Assertions.assertEquals("rtzju", model.subject()); - Assertions.assertEquals("wyzmhtxon", model.thumbprint()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T11:45:06Z"), model.validFrom()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T14:23:48Z"), model.validTo()); - Assertions.assertEquals("cswsrtjri", model.globalAcsNamespace()); - Assertions.assertEquals("lrbpbewtghfgbl", model.globalAcsHostname()); - Assertions.assertEquals("gw", model.globalAcsRPRealm()); + Assertions.assertEquals("wndnhj", model.friendlyName()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.issuer()); + Assertions.assertEquals(9120098526772116433L, model.resourceId()); + Assertions.assertEquals("wuwprzqlv", model.subject()); + Assertions.assertEquals("alupjm", model.thumbprint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T08:43:21Z"), model.validFrom()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T13:39:55Z"), model.validTo()); + Assertions.assertEquals("iotwmcdytdxwit", model.globalAcsNamespace()); + Assertions.assertEquals("nrjawgqwg", model.globalAcsHostname()); + Assertions.assertEquals("hniskxfbkpyc", model.globalAcsRPRealm()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProvidersGetOperationStatusWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProvidersGetOperationStatusWithResponseMockTests.java deleted file mode 100644 index 90d178606d851..0000000000000 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/ResourceProvidersGetOperationStatusWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.recoveryservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; -import com.azure.resourcemanager.recoveryservices.models.OperationResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersGetOperationStatusWithResponseMockTests { - @Test - public void testGetOperationStatusWithResponse() throws Exception { - String responseStr - = "{\"endTime\":\"2021-02-12T18:10:44Z\",\"id\":\"kfpagao\",\"name\":\"ulpqblylsyxkqjn\",\"status\":\"ervtiagxs\",\"startTime\":\"2021-09-29T10:51:16Z\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - RecoveryServicesManager manager = RecoveryServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationResource response = manager.resourceProviders() - .getOperationStatusWithResponse("ebwnujhe", "msbvdkcrodtjinf", "jlfltkacjvefkdlf", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T18:10:44Z"), response.endTime()); - Assertions.assertEquals("kfpagao", response.id()); - Assertions.assertEquals("ulpqblylsyxkqjn", response.name()); - Assertions.assertEquals("ervtiagxs", response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T10:51:16Z"), response.startTime()); - } -} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsMockTests.java index 48777ccdaa996..bd8906f0130e7 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/UsagesListByVaultsMockTests.java @@ -23,7 +23,7 @@ public final class UsagesListByVaultsMockTests { @Test public void testListByVaults() throws Exception { String responseStr - = "{\"value\":[{\"unit\":\"Percent\",\"quotaPeriod\":\"q\",\"nextResetTime\":\"2020-12-29T22:09:15Z\",\"currentValue\":8713386770833418913,\"limit\":843718939549204325,\"name\":{\"value\":\"hkh\",\"localizedValue\":\"xkhnzbonlwnto\"}}]}"; + = "{\"value\":[{\"unit\":\"Bytes\",\"quotaPeriod\":\"uzqogsexnevf\",\"nextResetTime\":\"2021-03-10T16:20:19Z\",\"currentValue\":8870331151727110664,\"limit\":1619893162220257557,\"name\":{\"value\":\"yceuzsoib\",\"localizedValue\":\"dpfrxtrthzvaytdw\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,15 +33,15 @@ public void testListByVaults() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.usages().listByVaults("zg", "zuf", com.azure.core.util.Context.NONE); + = manager.usages().listByVaults("aaabjyvayff", "m", com.azure.core.util.Context.NONE); - Assertions.assertEquals(UsagesUnit.PERCENT, response.iterator().next().unit()); - Assertions.assertEquals("q", response.iterator().next().quotaPeriod()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-29T22:09:15Z"), + Assertions.assertEquals(UsagesUnit.BYTES, response.iterator().next().unit()); + Assertions.assertEquals("uzqogsexnevf", response.iterator().next().quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T16:20:19Z"), response.iterator().next().nextResetTime()); - Assertions.assertEquals(8713386770833418913L, response.iterator().next().currentValue()); - Assertions.assertEquals(843718939549204325L, response.iterator().next().limit()); - Assertions.assertEquals("hkh", response.iterator().next().name().value()); - Assertions.assertEquals("xkhnzbonlwnto", response.iterator().next().name().localizedValue()); + Assertions.assertEquals(8870331151727110664L, response.iterator().next().currentValue()); + Assertions.assertEquals(1619893162220257557L, response.iterator().next().limit()); + Assertions.assertEquals("yceuzsoib", response.iterator().next().name().value()); + Assertions.assertEquals("dpfrxtrthzvaytdw", response.iterator().next().name().localizedValue()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateWithResponseMockTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateWithResponseMockTests.java index 0ba0991a7cae1..9dd91907f9981 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateWithResponseMockTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultCertificatesCreateWithResponseMockTests.java @@ -23,7 +23,7 @@ public final class VaultCertificatesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ResourceCertificateDetails\",\"friendlyName\":\"cnojvknmefqsg\",\"issuer\":\"ah\",\"resourceId\":8796329803823614210,\"subject\":\"hpvgqz\",\"thumbprint\":\"rvxdjzlmw\",\"validFrom\":\"2021-07-11T22:18:52Z\",\"validTo\":\"2021-11-03T14:53:04Z\"},\"id\":\"fhzovawjvzunluth\",\"name\":\"n\",\"type\":\"rnxipei\"}"; + = "{\"properties\":{\"authType\":\"ResourceCertificateDetails\",\"friendlyName\":\"kbegibt\",\"issuer\":\"xiebwwaloayqcg\",\"resourceId\":6136339981043942378,\"subject\":\"uzgwyzmhtx\",\"thumbprint\":\"gmtsavjcbpwxqpsr\",\"validFrom\":\"2021-10-15T11:22:09Z\",\"validTo\":\"2021-01-16T18:55:51Z\"},\"id\":\"uvriuhprwm\",\"name\":\"yvxqtayriwwroy\",\"type\":\"bexrmcq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,17 +33,17 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); VaultCertificateResponse response = manager.vaultCertificates() - .define("vxqtayriwwroyqbe") - .withExistingVault("vjcbpwxqpsrknf", "guvriuhprwmd") + .define("gw") + .withExistingVault("bbcswsrtjri", "lrbpbewtghfgbl") .withProperties(new RawCertificateData().withAuthType(AuthType.ACCESS_CONTROL_SERVICE)) .create(); - Assertions.assertEquals("cnojvknmefqsg", response.properties().friendlyName()); - Assertions.assertEquals("ah", response.properties().issuer()); - Assertions.assertEquals(8796329803823614210L, response.properties().resourceId()); - Assertions.assertEquals("hpvgqz", response.properties().subject()); - Assertions.assertEquals("rvxdjzlmw", response.properties().thumbprint()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T22:18:52Z"), response.properties().validFrom()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T14:53:04Z"), response.properties().validTo()); + Assertions.assertEquals("kbegibt", response.properties().friendlyName()); + Assertions.assertEquals("xiebwwaloayqcg", response.properties().issuer()); + Assertions.assertEquals(6136339981043942378L, response.properties().resourceId()); + Assertions.assertEquals("uzgwyzmhtx", response.properties().subject()); + Assertions.assertEquals("gmtsavjcbpwxqpsr", response.properties().thumbprint()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T11:22:09Z"), response.properties().validFrom()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T18:55:51Z"), response.properties().validTo()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageInnerTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageInnerTests.java index 91a97a19c20c5..d103b0a36c7ff 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageInnerTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageInnerTests.java @@ -15,32 +15,32 @@ public final class VaultUsageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VaultUsageInner model = BinaryData.fromString( - "{\"unit\":\"Percent\",\"quotaPeriod\":\"isgwbnbbeldawkz\",\"nextResetTime\":\"2021-01-06T08:15:40Z\",\"currentValue\":489170478703847309,\"limit\":4089645691345581060,\"name\":{\"value\":\"auhashsfwx\",\"localizedValue\":\"owzxcu\"}}") + "{\"unit\":\"Seconds\",\"quotaPeriod\":\"v\",\"nextResetTime\":\"2021-01-05T18:56:58Z\",\"currentValue\":2755642234733454971,\"limit\":1169778557052880447,\"name\":{\"value\":\"deemao\",\"localizedValue\":\"xagkvtmelmqkrh\"}}") .toObject(VaultUsageInner.class); - Assertions.assertEquals(UsagesUnit.PERCENT, model.unit()); - Assertions.assertEquals("isgwbnbbeldawkz", model.quotaPeriod()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T08:15:40Z"), model.nextResetTime()); - Assertions.assertEquals(489170478703847309L, model.currentValue()); - Assertions.assertEquals(4089645691345581060L, model.limit()); - Assertions.assertEquals("auhashsfwx", model.name().value()); - Assertions.assertEquals("owzxcu", model.name().localizedValue()); + Assertions.assertEquals(UsagesUnit.SECONDS, model.unit()); + Assertions.assertEquals("v", model.quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T18:56:58Z"), model.nextResetTime()); + Assertions.assertEquals(2755642234733454971L, model.currentValue()); + Assertions.assertEquals(1169778557052880447L, model.limit()); + Assertions.assertEquals("deemao", model.name().value()); + Assertions.assertEquals("xagkvtmelmqkrh", model.name().localizedValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VaultUsageInner model = new VaultUsageInner().withUnit(UsagesUnit.PERCENT) - .withQuotaPeriod("isgwbnbbeldawkz") - .withNextResetTime(OffsetDateTime.parse("2021-01-06T08:15:40Z")) - .withCurrentValue(489170478703847309L) - .withLimit(4089645691345581060L) - .withName(new NameInfo().withValue("auhashsfwx").withLocalizedValue("owzxcu")); + VaultUsageInner model = new VaultUsageInner().withUnit(UsagesUnit.SECONDS) + .withQuotaPeriod("v") + .withNextResetTime(OffsetDateTime.parse("2021-01-05T18:56:58Z")) + .withCurrentValue(2755642234733454971L) + .withLimit(1169778557052880447L) + .withName(new NameInfo().withValue("deemao").withLocalizedValue("xagkvtmelmqkrh")); model = BinaryData.fromObject(model).toObject(VaultUsageInner.class); - Assertions.assertEquals(UsagesUnit.PERCENT, model.unit()); - Assertions.assertEquals("isgwbnbbeldawkz", model.quotaPeriod()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T08:15:40Z"), model.nextResetTime()); - Assertions.assertEquals(489170478703847309L, model.currentValue()); - Assertions.assertEquals(4089645691345581060L, model.limit()); - Assertions.assertEquals("auhashsfwx", model.name().value()); - Assertions.assertEquals("owzxcu", model.name().localizedValue()); + Assertions.assertEquals(UsagesUnit.SECONDS, model.unit()); + Assertions.assertEquals("v", model.quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T18:56:58Z"), model.nextResetTime()); + Assertions.assertEquals(2755642234733454971L, model.currentValue()); + Assertions.assertEquals(1169778557052880447L, model.limit()); + Assertions.assertEquals("deemao", model.name().value()); + Assertions.assertEquals("xagkvtmelmqkrh", model.name().localizedValue()); } } diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageListTests.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageListTests.java index 7e2a8e6ba0715..3c31a2c8eff70 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageListTests.java +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/test/java/com/azure/resourcemanager/recoveryservices/generated/VaultUsageListTests.java @@ -17,45 +17,39 @@ public final class VaultUsageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VaultUsageList model = BinaryData.fromString( - "{\"value\":[{\"unit\":\"Percent\",\"quotaPeriod\":\"hrxsbk\",\"nextResetTime\":\"2021-08-06T06:24:23Z\",\"currentValue\":1245497822937083948,\"limit\":1835147591912684740,\"name\":{\"value\":\"zka\",\"localizedValue\":\"uwbc\"}},{\"unit\":\"Percent\",\"quotaPeriod\":\"mehhseyvjusrtsl\",\"nextResetTime\":\"2021-07-14T16:11:44Z\",\"currentValue\":6698294689469432122,\"limit\":1190726733123875676,\"name\":{\"value\":\"mx\",\"localizedValue\":\"kv\"}},{\"unit\":\"Count\",\"quotaPeriod\":\"mqkrhahvljuahaqu\",\"nextResetTime\":\"2021-02-06T01:31:14Z\",\"currentValue\":4535829174726898901,\"limit\":9171481587703972041,\"name\":{\"value\":\"xqpvfadmw\",\"localizedValue\":\"crgvxpvgom\"}}]}") + "{\"value\":[{\"unit\":\"Seconds\",\"quotaPeriod\":\"pz\",\"nextResetTime\":\"2021-05-21T05:23:51Z\",\"currentValue\":6087131419458323367,\"limit\":2277535144255584370,\"name\":{\"value\":\"bh\",\"localizedValue\":\"frlh\"}},{\"unit\":\"Bytes\",\"quotaPeriod\":\"kyv\",\"nextResetTime\":\"2021-08-31T04:23:50Z\",\"currentValue\":946204194354217219,\"limit\":2545482303013811667,\"name\":{\"value\":\"afkuwb\",\"localizedValue\":\"nwbmeh\"}}]}") .toObject(VaultUsageList.class); - Assertions.assertEquals(UsagesUnit.PERCENT, model.value().get(0).unit()); - Assertions.assertEquals("hrxsbk", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T06:24:23Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals(1245497822937083948L, model.value().get(0).currentValue()); - Assertions.assertEquals(1835147591912684740L, model.value().get(0).limit()); - Assertions.assertEquals("zka", model.value().get(0).name().value()); - Assertions.assertEquals("uwbc", model.value().get(0).name().localizedValue()); + Assertions.assertEquals(UsagesUnit.SECONDS, model.value().get(0).unit()); + Assertions.assertEquals("pz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T05:23:51Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals(6087131419458323367L, model.value().get(0).currentValue()); + Assertions.assertEquals(2277535144255584370L, model.value().get(0).limit()); + Assertions.assertEquals("bh", model.value().get(0).name().value()); + Assertions.assertEquals("frlh", model.value().get(0).name().localizedValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VaultUsageList model = new VaultUsageList().withValue(Arrays.asList( - new VaultUsageInner().withUnit(UsagesUnit.PERCENT) - .withQuotaPeriod("hrxsbk") - .withNextResetTime(OffsetDateTime.parse("2021-08-06T06:24:23Z")) - .withCurrentValue(1245497822937083948L) - .withLimit(1835147591912684740L) - .withName(new NameInfo().withValue("zka").withLocalizedValue("uwbc")), - new VaultUsageInner().withUnit(UsagesUnit.PERCENT) - .withQuotaPeriod("mehhseyvjusrtsl") - .withNextResetTime(OffsetDateTime.parse("2021-07-14T16:11:44Z")) - .withCurrentValue(6698294689469432122L) - .withLimit(1190726733123875676L) - .withName(new NameInfo().withValue("mx").withLocalizedValue("kv")), - new VaultUsageInner().withUnit(UsagesUnit.COUNT) - .withQuotaPeriod("mqkrhahvljuahaqu") - .withNextResetTime(OffsetDateTime.parse("2021-02-06T01:31:14Z")) - .withCurrentValue(4535829174726898901L) - .withLimit(9171481587703972041L) - .withName(new NameInfo().withValue("xqpvfadmw").withLocalizedValue("crgvxpvgom")))); + new VaultUsageInner().withUnit(UsagesUnit.SECONDS) + .withQuotaPeriod("pz") + .withNextResetTime(OffsetDateTime.parse("2021-05-21T05:23:51Z")) + .withCurrentValue(6087131419458323367L) + .withLimit(2277535144255584370L) + .withName(new NameInfo().withValue("bh").withLocalizedValue("frlh")), + new VaultUsageInner().withUnit(UsagesUnit.BYTES) + .withQuotaPeriod("kyv") + .withNextResetTime(OffsetDateTime.parse("2021-08-31T04:23:50Z")) + .withCurrentValue(946204194354217219L) + .withLimit(2545482303013811667L) + .withName(new NameInfo().withValue("afkuwb").withLocalizedValue("nwbmeh")))); model = BinaryData.fromObject(model).toObject(VaultUsageList.class); - Assertions.assertEquals(UsagesUnit.PERCENT, model.value().get(0).unit()); - Assertions.assertEquals("hrxsbk", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T06:24:23Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals(1245497822937083948L, model.value().get(0).currentValue()); - Assertions.assertEquals(1835147591912684740L, model.value().get(0).limit()); - Assertions.assertEquals("zka", model.value().get(0).name().value()); - Assertions.assertEquals("uwbc", model.value().get(0).name().localizedValue()); + Assertions.assertEquals(UsagesUnit.SECONDS, model.value().get(0).unit()); + Assertions.assertEquals("pz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T05:23:51Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals(6087131419458323367L, model.value().get(0).currentValue()); + Assertions.assertEquals(2277535144255584370L, model.value().get(0).limit()); + Assertions.assertEquals("bh", model.value().get(0).name().value()); + Assertions.assertEquals("frlh", model.value().get(0).name().localizedValue()); } }