diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json
index 9f3d9929a12e0..c430ade280ace 100644
--- a/sdk/resourcemanager/api-specs.json
+++ b/sdk/resourcemanager/api-specs.json
@@ -3,86 +3,86 @@
"dir": "azure-resourcemanager-appplatform",
"source": "specification/appplatform/resource-manager/readme.md",
"package": "com.azure.resourcemanager.appplatform",
- "args": "--tag=package-2023-12 --remove-inner=TestKeys,ResourceSku,ResourceUploadDefinition,CustomDomainValidateResult,NameAvailability"
+ "args": "--tag=package-2023-12 --remove-inner=TestKeys,ResourceSku,ResourceUploadDefinition,CustomDomainValidateResult,NameAvailability --stream-style-serialization=false"
},
"appservice": {
"dir": "azure-resourcemanager-appservice",
"source": "specification/web/resource-manager/readme.md",
"package": "com.azure.resourcemanager.appservice",
- "args": "--tag=package-2023-12 --add-inner=AppServiceCertificate --remove-inner=CsmDeploymentStatus --name-for-ungrouped-operations=ResourceProvider"
+ "args": "--tag=package-2023-12 --add-inner=AppServiceCertificate --remove-inner=CsmDeploymentStatus --name-for-ungrouped-operations=ResourceProvider --stream-style-serialization=false"
},
"appservice-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-appservice",
"source": "specification/web/resource-manager/readme.md",
"package": "com.azure.resourcemanager.appservice",
- "args": "--tag=profile-hybrid-2020-09-01 --add-inner=AppServiceCertificate --name-for-ungrouped-operations=ResourceProvider",
+ "args": "--tag=profile-hybrid-2020-09-01 --add-inner=AppServiceCertificate --name-for-ungrouped-operations=ResourceProvider --stream-style-serialization=false",
"note": "Add status code '200' to 'syncFunctionTriggers'"
},
"authorization": {
"dir": "azure-resourcemanager-authorization",
"source": "specification/authorization/resource-manager/readme.md",
"package": "com.azure.resourcemanager.authorization",
- "args": "--tag=package-2022-04-01"
+ "args": "--tag=package-2022-04-01 --stream-style-serialization=false"
},
"authorization-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization",
"source": "specification/authorization/resource-manager/readme.md",
"package": "com.azure.resourcemanager.authorization",
- "args": "--tag=profile-hybrid-2020-09-01"
+ "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false"
},
"cdn": {
"dir": "azure-resourcemanager-cdn",
"source": "specification/cdn/resource-manager/readme.md",
"package": "com.azure.resourcemanager.cdn",
- "args": "--tag=package-2024-02 --rename-model=CdnEndpoint:EndpointResource"
+ "args": "--tag=package-2024-02 --rename-model=CdnEndpoint:EndpointResource --stream-style-serialization=false"
},
"compute": {
"dir": "azure-resourcemanager-compute",
"source": "specification/compute/resource-manager/readme.md",
"package": "com.azure.resourcemanager.compute",
- "args": "--tag=package-2024-03-02 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --remove-inner=StorageProfile"
+ "args": "--tag=package-2024-03-02 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --remove-inner=StorageProfile --stream-style-serialization=false"
},
"compute-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-compute",
"source": "specification/compute/resource-manager/readme.md",
"package": "com.azure.resourcemanager.compute",
- "args": "--tag=profile-hybrid-2020-09-01 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes"
+ "args": "--tag=profile-hybrid-2020-09-01 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --stream-style-serialization=false"
},
"containerinstance": {
"dir": "azure-resourcemanager-containerinstance",
"source": "specification/containerinstance/resource-manager/readme.md",
"package": "com.azure.resourcemanager.containerinstance",
- "args": "--tag=package-2023-05 --remove-inner=Container,Operation,CachedImages,Capabilities --rename-model=ContainerGroupPropertiesProperties:ContainerGroupProperties,UserAssignedIdentities:ContainerGroupIdentityUserAssignedIdentities"
+ "args": "--tag=package-2023-05 --remove-inner=Container,Operation,CachedImages,Capabilities --rename-model=ContainerGroupPropertiesProperties:ContainerGroupProperties,UserAssignedIdentities:ContainerGroupIdentityUserAssignedIdentities --stream-style-serialization=false"
},
"containerregistry": {
"dir": "azure-resourcemanager-containerregistry",
"source": "specification/containerregistry/resource-manager/readme.md",
"package": "com.azure.resourcemanager.containerregistry",
- "args": "--tag=package-2023-07 --modelerfour.lenient-model-deduplication=true"
+ "args": "--tag=package-2023-07 --modelerfour.lenient-model-deduplication=true --stream-style-serialization=false"
},
"containerregistry-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry",
"source": "specification/containerregistry/resource-manager/readme.md",
"package": "com.azure.resourcemanager.containerregistry",
- "args": "--tag=package-2019-05"
+ "args": "--tag=package-2019-05 --stream-style-serialization=false"
},
"containerservice": {
"dir": "azure-resourcemanager-containerservice",
"source": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md",
"package": "com.azure.resourcemanager.containerservice",
- "args": "--tag=package-2024-05 --modelerfour.lenient-model-deduplication --preserve-model=ContainerServiceVMSizeTypes --rename-model=Ossku:OSSku"
+ "args": "--tag=package-2024-05 --modelerfour.lenient-model-deduplication --preserve-model=ContainerServiceVMSizeTypes --rename-model=Ossku:OSSku --stream-style-serialization=false"
},
"containerservice-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-containerservice",
"source": "specification/containerservice/resource-manager/readme.md",
"package": "com.azure.resourcemanager.containerservice",
- "args": "--tag=profile-hybrid-2020-09-01 --preserve-model=ContainerServiceVMSizeTypes"
+ "args": "--tag=profile-hybrid-2020-09-01 --preserve-model=ContainerServiceVMSizeTypes --stream-style-serialization=false"
},
"cosmos": {
"dir": "azure-resourcemanager-cosmos",
"source": "specification/cosmos-db/resource-manager/readme.md",
"package": "com.azure.resourcemanager.cosmos",
- "args": "--tag=package-2024-05"
+ "args": "--tag=package-2024-05 --stream-style-serialization=false"
},
"deploymentstacks": {
"dir": "azure-resourcemanager-resources",
@@ -94,25 +94,25 @@
"dir": "azure-resourcemanager-dns",
"source": "specification/dns/resource-manager/readme.md",
"package": "com.azure.resourcemanager.dns",
- "args": "--tag=package-2018-05"
+ "args": "--tag=package-2018-05 --stream-style-serialization=false"
},
"dns-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-dns",
"source": "specification/dns/resource-manager/readme.md",
"package": "com.azure.resourcemanager.dns",
- "args": "--tag=package-2016-04"
+ "args": "--tag=package-2016-04 --stream-style-serialization=false"
},
"eventhubs": {
"dir": "azure-resourcemanager-eventhubs",
"source": "specification/eventhub/resource-manager/readme.md",
"package": "com.azure.resourcemanager.eventhubs",
- "args": "--tag=package-2024-01"
+ "args": "--tag=package-2024-01 --stream-style-serialization=false"
},
"eventhubs-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-eventhubs",
"source": "specification/eventhub/resource-manager/readme.md",
"package": "com.azure.resourcemanager.eventhubs",
- "args": "--tag=profile-hybrid-2020-09-01"
+ "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false"
},
"features": {
"dir": "azure-resourcemanager-resources",
@@ -131,26 +131,26 @@
"dir": "azure-resourcemanager-authorization",
"source": "azure-resourcemanager-authorization/swagger/swagger.md",
"package": "com.azure.resourcemanager.authorization",
- "args": "--tag=v1.0 --graalvm-config-suffix=msgraph --title=MicrosoftGraphClient --models-subpackage=fluent.models"
+ "args": "--tag=v1.0 --graalvm-config-suffix=msgraph --title=MicrosoftGraphClient --models-subpackage=fluent.models --stream-style-serialization=false"
},
"msgraph-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization",
"source": "specification/graphrbac/data-plane/readme.md",
"package": "com.azure.resourcemanager.authorization",
- "args": "--tag=1.6"
+ "args": "--tag=1.6 --stream-style-serialization=false"
},
"keyvault": {
"dir": "azure-resourcemanager-keyvault",
"source": "specification/keyvault/resource-manager/readme.md",
"package": "com.azure.resourcemanager.keyvault",
- "args": "--tag=package-2023-07",
+ "args": "--tag=package-2023-07 --stream-style-serialization=false",
"note": "use local azure-rest-api-specs and remove keys.json, secrets.json and keysManagedHsm.json in README.md tag"
},
"keyvault-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-keyvault",
"source": "specification/keyvault/resource-manager/readme.md",
"package": "com.azure.resourcemanager.keyvault",
- "args": "--tag=package-2019-09"
+ "args": "--tag=package-2019-09 --stream-style-serialization=false"
},
"locks": {
"dir": "azure-resourcemanager-resources",
@@ -162,33 +162,33 @@
"dir": "../resourcemanagerhybrid/azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
- "args": "--tag=package-locks-2016-09"
+ "args": "--tag=package-locks-2016-09 --stream-style-serialization=false"
},
"monitor": {
"dir": "azure-resourcemanager-monitor",
"source": "specification/monitor/resource-manager/readme.md",
"package": "com.azure.resourcemanager.monitor",
- "args": "--tag=package-composite-v1 --modelerfour.lenient-model-deduplication=true --add-inner=AutoscaleProfile,ScaleRule,LocalizableString,DiagnosticSettingsCategoryResourceCollection --rename-model=MetricUnit:Unit",
+ "args": "--tag=package-composite-v1 --modelerfour.lenient-model-deduplication=true --add-inner=AutoscaleProfile,ScaleRule,LocalizableString,DiagnosticSettingsCategoryResourceCollection --rename-model=MetricUnit:Unit --stream-style-serialization=false",
"note": "Use commit c0f92082a788895368a738a9200e24971157d7ca, and remove Swagger from Microsoft.Monitor"
},
"monitor-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-monitor",
"source": "specification/monitor/resource-manager/readme.md",
"package": "com.azure.resourcemanager.monitor",
- "args": "--tag=package-2021-04 --add-inner=AutoscaleProfile,ScaleRule,LocalizableString --rename-model=MetricUnit:Unit"
+ "args": "--tag=package-2021-04 --add-inner=AutoscaleProfile,ScaleRule,LocalizableString --rename-model=MetricUnit:Unit --stream-style-serialization=false"
},
"network": {
"dir": "azure-resourcemanager-network",
"source": "specification/network/resource-manager/readme.md",
"package": "com.azure.resourcemanager.network",
- "args": "--tag=package-2024-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture,ApplicationGateway,ApplicationGatewayListener",
+ "args": "--tag=package-2024-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture,ApplicationGateway,ApplicationGatewayListener --stream-style-serialization=false",
"note": "Run DeprecateApplicationGatewaySku to deprecate v1 sku/tier in ApplicationGatewaySku."
},
"network-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-network",
"source": "specification/network/resource-manager/readme.md",
"package": "com.azure.resourcemanager.network",
- "args": "--tag=profile-hybrid-2020-09-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture --remove-inner=Ipv6ExpressRouteCircuitPeeringConfig"
+ "args": "--tag=profile-hybrid-2020-09-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture --remove-inner=Ipv6ExpressRouteCircuitPeeringConfig --stream-style-serialization=false"
},
"policy": {
"dir": "azure-resourcemanager-resources",
@@ -201,26 +201,26 @@
"dir": "../resourcemanagerhybrid/azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
- "args": "--tag=package-policy-2016-12"
+ "args": "--tag=package-policy-2016-12 --stream-style-serialization=false"
},
"privatedns": {
"dir": "azure-resourcemanager-privatedns",
"source": "specification/privatedns/resource-manager/readme.md",
"package": "com.azure.resourcemanager.privatedns",
- "args": "--tag=package-2020-06"
+ "args": "--tag=package-2020-06 --stream-style-serialization=false"
},
"redis": {
"dir": "azure-resourcemanager-redis",
"source": "specification/redis/resource-manager/readme.md",
"package": "com.azure.resourcemanager.redis",
- "args": "--tag=package-2024-03 --rename-model=ErrorDetailAutoGenerated:ErrorDetail,RedisCommonPropertiesRedisConfiguration:RedisConfiguration --remove-inner=OperationStatusResult",
+ "args": "--tag=package-2024-03 --rename-model=ErrorDetailAutoGenerated:ErrorDetail,RedisCommonPropertiesRedisConfiguration:RedisConfiguration --remove-inner=OperationStatusResult --stream-style-serialization=false",
"note": "run RedisConfigurationTests.generateConfigurationUtils and copy output code snippet to ConfigurationUtils"
},
"relay": {
"dir": "azure-resourcemanager-relay",
"source": "specification/relay/resource-manager/readme.md",
"package": "com.microsoft.azure.resourcemanager.relay",
- "args": "--tag=package-2017-04"
+ "args": "--tag=package-2017-04 --stream-style-serialization=false"
},
"resources": {
"dir": "azure-resourcemanager-resources",
@@ -232,39 +232,39 @@
"dir": "../resourcemanagerhybrid/azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
- "args": "--tag=package-resources-2019-10 --add-inner=Deployment"
+ "args": "--tag=package-resources-2019-10 --add-inner=Deployment --stream-style-serialization=false"
},
"search": {
"dir": "azure-resourcemanager-search",
"source": "specification/search/resource-manager/readme.md",
"package": "com.azure.resourcemanager.search",
- "args": "--tag=package-2023-11 --remove-inner=CheckNameAvailabilityOutput"
+ "args": "--tag=package-2023-11 --remove-inner=CheckNameAvailabilityOutput --stream-style-serialization=false"
},
"servicebus": {
"dir": "azure-resourcemanager-servicebus",
"source": "specification/servicebus/resource-manager/readme.md",
"package": "com.azure.resourcemanager.servicebus",
- "args": "--tag=package-2021-11",
+ "args": "--tag=package-2021-11 --stream-style-serialization=false",
"note": "1. Add '@JsonSerialize(using = DurationSerializer.class)' to properties of 'Duration' type of class 'SBTopicInnerProperties', 'SBTopicInnerProperties', 'SBTopicInnerProperties'; 2. Change parent class of class 'SBTopicInner', 'SBQueueInner' and 'SBSubscriptionInner' to 'Resource', not 'ProxyResource'"
},
"sql": {
"dir": "azure-resourcemanager-sql",
"source": "specification/sql/resource-manager/readme.md",
"package": "com.azure.resourcemanager.sql",
- "args": "--tag=package-2021-11 --modelerfour.lenient-model-deduplication=true --rename-model=SecurityAlertsPolicyState:SecurityAlertPolicyState",
+ "args": "--tag=package-2021-11 --modelerfour.lenient-model-deduplication=true --rename-model=SecurityAlertsPolicyState:SecurityAlertPolicyState --stream-style-serialization=false",
"note": "Add '\"x-ms-long-running-operation\": true' to TransparentDataEncryptions_CreateOrUpdate in specs file TransparentDataEncryptions.json"
},
"storage": {
"dir": "azure-resourcemanager-storage",
"source": "specification/storage/resource-manager/readme.md",
"package": "com.azure.resourcemanager.storage",
- "args": "--tag=package-2023-05 --modelerfour.lenient-model-deduplication --rename-model=AllowedMethods:CorsRuleAllowedMethodsItem,AccountType:ActiveDirectoryPropertiesAccountType --property-include-always=EncryptionIdentity.encryptionUserAssignedIdentity"
+ "args": "--tag=package-2023-05 --modelerfour.lenient-model-deduplication --rename-model=AllowedMethods:CorsRuleAllowedMethodsItem,AccountType:ActiveDirectoryPropertiesAccountType --property-include-always=EncryptionIdentity.encryptionUserAssignedIdentity --stream-style-serialization=false"
},
"storage-hybrid": {
"dir": "../resourcemanagerhybrid/azure-resourcemanager-storage",
"source": "specification/storage/resource-manager/readme.md",
"package": "com.azure.resourcemanager.storage",
- "args": "--tag=profile-hybrid-2020-09-01"
+ "args": "--tag=profile-hybrid-2020-09-01 --stream-style-serialization=false"
},
"subscriptions": {
"dir": "azure-resourcemanager-resources",
@@ -276,19 +276,19 @@
"dir": "../resourcemanagerhybrid/azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
- "args": "--tag=package-subscriptions-2016-06 --name-for-ungrouped-operations=ResourceName"
+ "args": "--tag=package-subscriptions-2016-06 --name-for-ungrouped-operations=ResourceName --stream-style-serialization=false"
},
"trafficmanager": {
"dir": "azure-resourcemanager-trafficmanager",
"source": "specification/trafficmanager/resource-manager/readme.md",
"package": "com.azure.resourcemanager.trafficmanager",
- "args": "--tag=package-2022-04 --rename-model=EndpointType:EndpointTypes"
+ "args": "--tag=package-2022-04 --rename-model=EndpointType:EndpointTypes --stream-style-serialization=false"
},
"msi": {
"dir": "azure-resourcemanager-msi",
"source": "specification/msi/resource-manager/readme.md",
"package": "com.azure.resourcemanager.msi",
- "args": "--tag=package-2023-01-31 --add-client-flatten=Identity"
+ "args": "--tag=package-2023-01-31 --add-client-flatten=Identity --stream-style-serialization=false"
},
"changes": {
"dir": "azure-resourcemanager-resources",
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml b/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml
index 694bdb11886f2..79b49affee09f 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml
@@ -67,6 +67,11 @@
azure-core-management
1.15.1
+
+ com.azure
+ azure-json
+ 1.2.0
+
org.slf4j
slf4j-simple
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java
index 5b32e07c46644..c21c898c0a3fa 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java
@@ -334,7 +334,7 @@ public interface TagOperationsClient {
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -351,7 +351,7 @@ public interface TagOperationsClient {
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -368,7 +368,7 @@ PollerFlux, TagsResourceInner> beginCreateOrUpdate
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -385,7 +385,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -403,7 +403,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -419,7 +419,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -435,7 +435,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* specified entity can have a maximum of 50 tags.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags API requests and responses.
+ * @param parameters The parameters parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -455,7 +455,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -475,7 +475,7 @@ SyncPoller, TagsResourceInner> beginCreateOrUpdate
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -495,7 +495,7 @@ PollerFlux, TagsResourceInner> beginUpdateAtScopeA
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -515,7 +515,7 @@ SyncPoller, TagsResourceInner> beginUpdateAtScope(
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -536,7 +536,7 @@ SyncPoller, TagsResourceInner> beginUpdateAtScope(
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -555,7 +555,7 @@ SyncPoller, TagsResourceInner> beginUpdateAtScope(
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -574,7 +574,7 @@ SyncPoller, TagsResourceInner> beginUpdateAtScope(
* name/value pairs.
*
* @param scope The resource scope.
- * @param parameters Wrapper resource for tags patch API request only.
+ * @param parameters The parameters parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java
index 9dca7b1710dc8..147d51ec1e61b 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.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.resources.models.ChangeProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Change Resource.
@@ -17,9 +20,23 @@ public final class ChangeResourceResultInner extends ProxyResource {
/*
* The properties of a change
*/
- @JsonProperty(value = "properties")
private ChangeProperties properties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of ChangeResourceResultInner class.
*/
@@ -46,6 +63,36 @@ public ChangeResourceResultInner withProperties(ChangeProperties properties) {
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Validates the instance.
*
@@ -56,4 +103,47 @@ 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 ChangeResourceResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ChangeResourceResultInner 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 ChangeResourceResultInner.
+ */
+ public static ChangeResourceResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ChangeResourceResultInner deserializedChangeResourceResultInner = new ChangeResourceResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedChangeResourceResultInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedChangeResourceResultInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedChangeResourceResultInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedChangeResourceResultInner.properties = ChangeProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedChangeResourceResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java
index 766eeecacbafc..d256286a102a9 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java
@@ -5,30 +5,31 @@
package com.azure.resourcemanager.resources.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.resources.models.ResourceNameStatus;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word.
*/
@Fluent
-public final class CheckResourceNameResultInner {
+public final class CheckResourceNameResultInner implements JsonSerializable {
/*
* Name of Resource
*/
- @JsonProperty(value = "name")
private String name;
/*
* Type of Resource
*/
- @JsonProperty(value = "type")
private String type;
/*
* Is the resource name Allowed or Reserved
*/
- @JsonProperty(value = "status")
private ResourceNameStatus status;
/**
@@ -104,4 +105,46 @@ public CheckResourceNameResultInner withStatus(ResourceNameStatus status) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeStringField("type", this.type);
+ jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CheckResourceNameResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CheckResourceNameResultInner 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 CheckResourceNameResultInner.
+ */
+ public static CheckResourceNameResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CheckResourceNameResultInner deserializedCheckResourceNameResultInner = new CheckResourceNameResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedCheckResourceNameResultInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedCheckResourceNameResultInner.type = reader.getString();
+ } else if ("status".equals(fieldName)) {
+ deserializedCheckResourceNameResultInner.status = ResourceNameStatus.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCheckResourceNameResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckZonePeersResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckZonePeersResultInner.java
index 06b465b2cc29f..c0a2c44d72d12 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckZonePeersResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckZonePeersResultInner.java
@@ -5,31 +5,32 @@
package com.azure.resourcemanager.resources.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.resources.models.AvailabilityZonePeers;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Result of the Check zone peers operation.
*/
@Fluent
-public final class CheckZonePeersResultInner {
+public final class CheckZonePeersResultInner implements JsonSerializable {
/*
* The subscription ID.
*/
- @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY)
private String subscriptionId;
/*
* the location of the subscription.
*/
- @JsonProperty(value = "location")
private String location;
/*
* The Availability Zones shared by the subscriptions.
*/
- @JsonProperty(value = "availabilityZonePeers")
private List availabilityZonePeers;
/**
@@ -97,4 +98,48 @@ public void validate() {
availabilityZonePeers().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", this.location);
+ jsonWriter.writeArrayField("availabilityZonePeers", this.availabilityZonePeers,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CheckZonePeersResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CheckZonePeersResultInner 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 CheckZonePeersResultInner.
+ */
+ public static CheckZonePeersResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CheckZonePeersResultInner deserializedCheckZonePeersResultInner = new CheckZonePeersResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("subscriptionId".equals(fieldName)) {
+ deserializedCheckZonePeersResultInner.subscriptionId = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedCheckZonePeersResultInner.location = reader.getString();
+ } else if ("availabilityZonePeers".equals(fieldName)) {
+ List availabilityZonePeers
+ = reader.readArray(reader1 -> AvailabilityZonePeers.fromJson(reader1));
+ deserializedCheckZonePeersResultInner.availabilityZonePeers = availabilityZonePeers;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCheckZonePeersResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java
index 3de9854d85366..cd691970ae08c 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java
@@ -5,25 +5,28 @@
package com.azure.resourcemanager.resources.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.resources.models.DataManifestCustomResourceFunctionDefinition;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* The resource functions supported by a manifest.
*/
@Fluent
-public final class DataManifestResourceFunctionsDefinition {
+public final class DataManifestResourceFunctionsDefinition
+ implements JsonSerializable {
/*
* The standard resource functions (subscription and/or resourceGroup).
*/
- @JsonProperty(value = "standard")
private List standard;
/*
* An array of data manifest custom resource definition.
*/
- @JsonProperty(value = "custom")
private List custom;
/**
@@ -83,4 +86,47 @@ public void validate() {
custom().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("standard", this.standard, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeArrayField("custom", this.custom, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DataManifestResourceFunctionsDefinition from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataManifestResourceFunctionsDefinition 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 DataManifestResourceFunctionsDefinition.
+ */
+ public static DataManifestResourceFunctionsDefinition fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataManifestResourceFunctionsDefinition deserializedDataManifestResourceFunctionsDefinition
+ = new DataManifestResourceFunctionsDefinition();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("standard".equals(fieldName)) {
+ List standard = reader.readArray(reader1 -> reader1.getString());
+ deserializedDataManifestResourceFunctionsDefinition.standard = standard;
+ } else if ("custom".equals(fieldName)) {
+ List custom
+ = reader.readArray(reader1 -> DataManifestCustomResourceFunctionDefinition.fromJson(reader1));
+ deserializedDataManifestResourceFunctionsDefinition.custom = custom;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDataManifestResourceFunctionsDefinition;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java
index 6b787167ee331..11aaf2002ed46 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java
@@ -6,10 +6,13 @@
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.resources.models.DataEffect;
import com.azure.resourcemanager.resources.models.DataManifestCustomResourceFunctionDefinition;
import com.azure.resourcemanager.resources.models.ResourceTypeAliases;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
@@ -20,9 +23,23 @@ public final class DataPolicyManifestInner extends ProxyResource {
/*
* The data policy manifest properties.
*/
- @JsonProperty(value = "properties")
private DataPolicyManifestProperties innerProperties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of DataPolicyManifestInner class.
*/
@@ -38,6 +55,36 @@ private DataPolicyManifestProperties innerProperties() {
return this.innerProperties;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the namespaces property: The list of namespaces for the data policy manifest.
*
@@ -232,4 +279,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 DataPolicyManifestInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataPolicyManifestInner 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 DataPolicyManifestInner.
+ */
+ public static DataPolicyManifestInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataPolicyManifestInner deserializedDataPolicyManifestInner = new DataPolicyManifestInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDataPolicyManifestInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDataPolicyManifestInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDataPolicyManifestInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedDataPolicyManifestInner.innerProperties = DataPolicyManifestProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDataPolicyManifestInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java
index 0b97efd7558e3..55ff50b7f52a7 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java
@@ -5,57 +5,54 @@
package com.azure.resourcemanager.resources.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.resources.models.DataEffect;
import com.azure.resourcemanager.resources.models.DataManifestCustomResourceFunctionDefinition;
import com.azure.resourcemanager.resources.models.ResourceTypeAliases;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* The properties of the data policy manifest.
*/
@Fluent
-public final class DataPolicyManifestProperties {
+public final class DataPolicyManifestProperties implements JsonSerializable {
/*
* The list of namespaces for the data policy manifest.
*/
- @JsonProperty(value = "namespaces")
private List namespaces;
/*
* The policy mode of the data policy manifest.
*/
- @JsonProperty(value = "policyMode")
private String policyMode;
/*
* A value indicating whether policy mode is allowed only in built-in definitions.
*/
- @JsonProperty(value = "isBuiltInOnly")
private Boolean isBuiltInOnly;
/*
* An array of resource type aliases.
*/
- @JsonProperty(value = "resourceTypeAliases")
private List resourceTypeAliases;
/*
* The effect definition.
*/
- @JsonProperty(value = "effects")
private List effects;
/*
* The non-alias field accessor values that can be used in the policy rule.
*/
- @JsonProperty(value = "fieldValues")
private List fieldValues;
/*
* The resource functions definition specified in the data manifest.
*/
- @JsonProperty(value = "resourceFunctions")
private DataManifestResourceFunctionsDefinition innerResourceFunctions;
/**
@@ -255,4 +252,65 @@ public void validate() {
innerResourceFunctions().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("namespaces", this.namespaces, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("policyMode", this.policyMode);
+ jsonWriter.writeBooleanField("isBuiltInOnly", this.isBuiltInOnly);
+ jsonWriter.writeArrayField("resourceTypeAliases", this.resourceTypeAliases,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("effects", this.effects, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("fieldValues", this.fieldValues, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("resourceFunctions", this.innerResourceFunctions);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DataPolicyManifestProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataPolicyManifestProperties 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 DataPolicyManifestProperties.
+ */
+ public static DataPolicyManifestProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataPolicyManifestProperties deserializedDataPolicyManifestProperties = new DataPolicyManifestProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("namespaces".equals(fieldName)) {
+ List namespaces = reader.readArray(reader1 -> reader1.getString());
+ deserializedDataPolicyManifestProperties.namespaces = namespaces;
+ } else if ("policyMode".equals(fieldName)) {
+ deserializedDataPolicyManifestProperties.policyMode = reader.getString();
+ } else if ("isBuiltInOnly".equals(fieldName)) {
+ deserializedDataPolicyManifestProperties.isBuiltInOnly = reader.getNullable(JsonReader::getBoolean);
+ } else if ("resourceTypeAliases".equals(fieldName)) {
+ List resourceTypeAliases
+ = reader.readArray(reader1 -> ResourceTypeAliases.fromJson(reader1));
+ deserializedDataPolicyManifestProperties.resourceTypeAliases = resourceTypeAliases;
+ } else if ("effects".equals(fieldName)) {
+ List effects = reader.readArray(reader1 -> DataEffect.fromJson(reader1));
+ deserializedDataPolicyManifestProperties.effects = effects;
+ } else if ("fieldValues".equals(fieldName)) {
+ List fieldValues = reader.readArray(reader1 -> reader1.getString());
+ deserializedDataPolicyManifestProperties.fieldValues = fieldValues;
+ } else if ("resourceFunctions".equals(fieldName)) {
+ deserializedDataPolicyManifestProperties.innerResourceFunctions
+ = DataManifestResourceFunctionsDefinition.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDataPolicyManifestProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java
index 9a612dac2ff1c..f48b239f88296 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java
@@ -5,17 +5,20 @@
package com.azure.resourcemanager.resources.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;
/**
* The deployment export result.
*/
@Fluent
-public final class DeploymentExportResultInner {
+public final class DeploymentExportResultInner implements JsonSerializable {
/*
* The template content.
*/
- @JsonProperty(value = "template")
private Object template;
/**
@@ -51,4 +54,40 @@ public DeploymentExportResultInner withTemplate(Object template) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeUntypedField("template", this.template);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentExportResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentExportResultInner 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 DeploymentExportResultInner.
+ */
+ public static DeploymentExportResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentExportResultInner deserializedDeploymentExportResultInner = new DeploymentExportResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("template".equals(fieldName)) {
+ deserializedDeploymentExportResultInner.template = reader.readUntyped();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentExportResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java
index 63bee4a55871a..b548556552cf3 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.DeploymentPropertiesExtended;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,9 +21,23 @@ public final class DeploymentExtendedInner extends Resource {
/*
* Deployment properties.
*/
- @JsonProperty(value = "properties")
private DeploymentPropertiesExtended properties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of DeploymentExtendedInner class.
*/
@@ -47,6 +64,36 @@ public DeploymentExtendedInner withProperties(DeploymentPropertiesExtended prope
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* {@inheritDoc}
*/
@@ -75,4 +122,54 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentExtendedInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentExtendedInner 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 DeploymentExtendedInner.
+ */
+ public static DeploymentExtendedInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentExtendedInner deserializedDeploymentExtendedInner = new DeploymentExtendedInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDeploymentExtendedInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDeploymentExtendedInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDeploymentExtendedInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedDeploymentExtendedInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDeploymentExtendedInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeploymentExtendedInner.properties = DeploymentPropertiesExtended.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentExtendedInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java
index 9699f4cabedf0..2aeab634a7e06 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java
@@ -6,33 +6,32 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.DeploymentProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
* Deployment operation parameters.
*/
@Fluent
-public final class DeploymentInner {
+public final class DeploymentInner implements JsonSerializable {
/*
* The location to store the deployment data.
*/
- @JsonProperty(value = "location")
private String location;
/*
* The deployment properties.
*/
- @JsonProperty(value = "properties", required = true)
private DeploymentProperties properties;
/*
* Deployment tags
*/
- @JsonProperty(value = "tags")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map tags;
/**
@@ -116,4 +115,48 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(DeploymentInner.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("location", this.location);
+ jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentInner 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 DeploymentInner.
+ */
+ public static DeploymentInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentInner deserializedDeploymentInner = new DeploymentInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("properties".equals(fieldName)) {
+ deserializedDeploymentInner.properties = DeploymentProperties.fromJson(reader);
+ } else if ("location".equals(fieldName)) {
+ deserializedDeploymentInner.location = reader.getString();
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDeploymentInner.tags = tags;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java
index e241e9863229e..28adea77c6765 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java
@@ -5,30 +5,31 @@
package com.azure.resourcemanager.resources.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.resources.models.DeploymentOperationProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Deployment operation information.
*/
@Fluent
-public final class DeploymentOperationInner {
+public final class DeploymentOperationInner implements JsonSerializable {
/*
* Full deployment operation ID.
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* Deployment operation ID.
*/
- @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY)
private String operationId;
/*
* Deployment properties.
*/
- @JsonProperty(value = "properties")
private DeploymentOperationProperties properties;
/**
@@ -85,4 +86,44 @@ 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 DeploymentOperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentOperationInner 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 DeploymentOperationInner.
+ */
+ public static DeploymentOperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentOperationInner deserializedDeploymentOperationInner = new DeploymentOperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDeploymentOperationInner.id = reader.getString();
+ } else if ("operationId".equals(fieldName)) {
+ deserializedDeploymentOperationInner.operationId = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeploymentOperationInner.properties = DeploymentOperationProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentOperationInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackInner.java
index 1a5139cf4d260..e8c324210bc25 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackInner.java
@@ -5,7 +5,11 @@
package com.azure.resourcemanager.resources.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.management.SystemData;
import com.azure.core.management.exception.ManagementError;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ActionOnUnmanage;
import com.azure.resourcemanager.resources.models.AzureResourceBase;
import com.azure.resourcemanager.resources.models.DenySettings;
@@ -17,8 +21,7 @@
import com.azure.resourcemanager.resources.models.ManagedResourceReference;
import com.azure.resourcemanager.resources.models.ResourceReference;
import com.azure.resourcemanager.resources.models.ResourceReferenceExtended;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -28,24 +31,41 @@
@Fluent
public final class DeploymentStackInner extends AzureResourceBase {
/*
- * The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations.
+ * The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure
+ * locations.
*/
- @JsonProperty(value = "location")
private String location;
/*
* Deployment stack resource tags.
*/
- @JsonProperty(value = "tags")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map tags;
/*
* Deployment stack properties.
*/
- @JsonProperty(value = "properties")
private DeploymentStackProperties innerProperties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
/**
* Creates an instance of DeploymentStackInner class.
*/
@@ -103,6 +123,46 @@ private DeploymentStackProperties innerProperties() {
return this.innerProperties;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ @Override
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
/**
* Get the template property: The template content. You use this element when you want to pass the template syntax
* directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string.
@@ -479,4 +539,56 @@ public void validate() {
innerProperties().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.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentStackInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentStackInner 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 DeploymentStackInner.
+ */
+ public static DeploymentStackInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentStackInner deserializedDeploymentStackInner = new DeploymentStackInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDeploymentStackInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDeploymentStackInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDeploymentStackInner.type = reader.getString();
+ } else if ("systemData".equals(fieldName)) {
+ deserializedDeploymentStackInner.systemData = SystemData.fromJson(reader);
+ } else if ("location".equals(fieldName)) {
+ deserializedDeploymentStackInner.location = reader.getString();
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDeploymentStackInner.tags = tags;
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeploymentStackInner.innerProperties = DeploymentStackProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentStackInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java
index b316f7c97303b..6d6df497998bf 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java
@@ -7,6 +7,10 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ActionOnUnmanage;
import com.azure.resourcemanager.resources.models.DenySettings;
import com.azure.resourcemanager.resources.models.DeploymentParameter;
@@ -17,8 +21,7 @@
import com.azure.resourcemanager.resources.models.ManagedResourceReference;
import com.azure.resourcemanager.resources.models.ResourceReference;
import com.azure.resourcemanager.resources.models.ResourceReferenceExtended;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -26,126 +29,119 @@
* Deployment stack properties.
*/
@Fluent
-public final class DeploymentStackProperties {
+public final class DeploymentStackProperties implements JsonSerializable {
/*
- * The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
+ * The template content. You use this element when you want to pass the template syntax directly in the request
+ * rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the
+ * templateLink property or the template property, but not both.
*/
- @JsonProperty(value = "template")
private Object template;
/*
* The URI of the template. Use either the templateLink property or the template property, but not both.
*/
- @JsonProperty(value = "templateLink")
private DeploymentStacksTemplateLink templateLink;
/*
- * Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both.
+ * Name and value pairs that define the deployment parameters for the template. Use this element when providing the
+ * parameter values directly in the request, rather than linking to an existing parameter file. Use either the
+ * parametersLink property or the parameters property, but not both.
*/
- @JsonProperty(value = "parameters")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map parameters;
/*
- * The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both.
+ * The URI of parameters file. Use this element to link to an existing parameters file. Use either the
+ * parametersLink property or the parameters property, but not both.
*/
- @JsonProperty(value = "parametersLink")
private DeploymentStacksParametersLink parametersLink;
/*
* Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted.
*/
- @JsonProperty(value = "actionOnUnmanage", required = true)
private ActionOnUnmanage actionOnUnmanage;
/*
* The debug setting of the deployment.
*/
- @JsonProperty(value = "debugSetting")
private DeploymentStacksDebugSetting debugSetting;
/*
* Flag to bypass service errors that indicate the stack resource list is not correctly synchronized.
*/
- @JsonProperty(value = "bypassStackOutOfSyncError")
private Boolean bypassStackOutOfSyncError;
/*
- * The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}').
+ * The scope at which the initial deployment should be created. If a scope is not specified, it will default to the
+ * scope of the deployment stack. Valid scopes are: management group (format:
+ * '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format:
+ * '/subscriptions/{subscriptionId}'), resource group (format:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}').
*/
- @JsonProperty(value = "deploymentScope")
private String deploymentScope;
/*
* Deployment stack description. Max length of 4096 characters.
*/
- @JsonProperty(value = "description")
private String description;
/*
* Defines how resources deployed by the stack are locked.
*/
- @JsonProperty(value = "denySettings", required = true)
private DenySettings denySettings;
/*
* State of the deployment stack.
*/
- @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private DeploymentStackProvisioningState provisioningState;
/*
- * The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing.
+ * The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for
+ * tracing.
*/
- @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY)
private String correlationId;
/*
- * An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack.
+ * An array of resources that were detached during the most recent Deployment stack update. Detached means that the
+ * resource was removed from the template, but no relevant deletion operations were specified. So, the resource
+ * still exists while no longer being associated with the stack.
*/
- @JsonProperty(value = "detachedResources", access = JsonProperty.Access.WRITE_ONLY)
private List detachedResources;
/*
- * An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified.
+ * An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the
+ * resource was removed from the template and relevant deletion operations were specified.
*/
- @JsonProperty(value = "deletedResources", access = JsonProperty.Access.WRITE_ONLY)
private List deletedResources;
/*
- * An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message.
+ * An array of resources that failed to reach goal state during the most recent update. Each resourceId is
+ * accompanied by an error message.
*/
- @JsonProperty(value = "failedResources", access = JsonProperty.Access.WRITE_ONLY)
private List failedResources;
/*
* An array of resources currently managed by the deployment stack.
*/
- @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY)
private List resources;
/*
* The resourceId of the deployment resource created by the deployment stack.
*/
- @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY)
private String deploymentId;
/*
* The outputs of the deployment resource created by the deployment stack.
*/
- @JsonProperty(value = "outputs", access = JsonProperty.Access.WRITE_ONLY)
private Object outputs;
/*
* The duration of the last successful Deployment stack update.
*/
- @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY)
private String duration;
/*
* The error detail.
*/
- @JsonProperty(value = "error")
private ManagementError error;
/**
@@ -536,4 +532,102 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(DeploymentStackProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("actionOnUnmanage", this.actionOnUnmanage);
+ jsonWriter.writeJsonField("denySettings", this.denySettings);
+ jsonWriter.writeUntypedField("template", this.template);
+ jsonWriter.writeJsonField("templateLink", this.templateLink);
+ jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("parametersLink", this.parametersLink);
+ jsonWriter.writeJsonField("debugSetting", this.debugSetting);
+ jsonWriter.writeBooleanField("bypassStackOutOfSyncError", this.bypassStackOutOfSyncError);
+ jsonWriter.writeStringField("deploymentScope", this.deploymentScope);
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeJsonField("error", this.error);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentStackProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentStackProperties 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 DeploymentStackProperties.
+ */
+ public static DeploymentStackProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentStackProperties deserializedDeploymentStackProperties = new DeploymentStackProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("actionOnUnmanage".equals(fieldName)) {
+ deserializedDeploymentStackProperties.actionOnUnmanage = ActionOnUnmanage.fromJson(reader);
+ } else if ("denySettings".equals(fieldName)) {
+ deserializedDeploymentStackProperties.denySettings = DenySettings.fromJson(reader);
+ } else if ("template".equals(fieldName)) {
+ deserializedDeploymentStackProperties.template = reader.readUntyped();
+ } else if ("templateLink".equals(fieldName)) {
+ deserializedDeploymentStackProperties.templateLink = DeploymentStacksTemplateLink.fromJson(reader);
+ } else if ("parameters".equals(fieldName)) {
+ Map parameters
+ = reader.readMap(reader1 -> DeploymentParameter.fromJson(reader1));
+ deserializedDeploymentStackProperties.parameters = parameters;
+ } else if ("parametersLink".equals(fieldName)) {
+ deserializedDeploymentStackProperties.parametersLink
+ = DeploymentStacksParametersLink.fromJson(reader);
+ } else if ("debugSetting".equals(fieldName)) {
+ deserializedDeploymentStackProperties.debugSetting = DeploymentStacksDebugSetting.fromJson(reader);
+ } else if ("bypassStackOutOfSyncError".equals(fieldName)) {
+ deserializedDeploymentStackProperties.bypassStackOutOfSyncError
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("deploymentScope".equals(fieldName)) {
+ deserializedDeploymentStackProperties.deploymentScope = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedDeploymentStackProperties.description = reader.getString();
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedDeploymentStackProperties.provisioningState
+ = DeploymentStackProvisioningState.fromString(reader.getString());
+ } else if ("correlationId".equals(fieldName)) {
+ deserializedDeploymentStackProperties.correlationId = reader.getString();
+ } else if ("detachedResources".equals(fieldName)) {
+ List detachedResources
+ = reader.readArray(reader1 -> ResourceReference.fromJson(reader1));
+ deserializedDeploymentStackProperties.detachedResources = detachedResources;
+ } else if ("deletedResources".equals(fieldName)) {
+ List deletedResources
+ = reader.readArray(reader1 -> ResourceReference.fromJson(reader1));
+ deserializedDeploymentStackProperties.deletedResources = deletedResources;
+ } else if ("failedResources".equals(fieldName)) {
+ List failedResources
+ = reader.readArray(reader1 -> ResourceReferenceExtended.fromJson(reader1));
+ deserializedDeploymentStackProperties.failedResources = failedResources;
+ } else if ("resources".equals(fieldName)) {
+ List resources
+ = reader.readArray(reader1 -> ManagedResourceReference.fromJson(reader1));
+ deserializedDeploymentStackProperties.resources = resources;
+ } else if ("deploymentId".equals(fieldName)) {
+ deserializedDeploymentStackProperties.deploymentId = reader.getString();
+ } else if ("outputs".equals(fieldName)) {
+ deserializedDeploymentStackProperties.outputs = reader.readUntyped();
+ } else if ("duration".equals(fieldName)) {
+ deserializedDeploymentStackProperties.duration = reader.getString();
+ } else if ("error".equals(fieldName)) {
+ deserializedDeploymentStackProperties.error = ManagementError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentStackProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java
index 54111050d4b14..5b6ef68d86203 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java
@@ -5,24 +5,29 @@
package com.azure.resourcemanager.resources.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.resources.models.DeploymentStacksTemplateLink;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Export Template specific properties of the Deployment stack.
*/
@Fluent
-public final class DeploymentStackTemplateDefinitionInner {
+public final class DeploymentStackTemplateDefinitionInner
+ implements JsonSerializable {
/*
- * The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
+ * The template content. Use this element to pass the template syntax directly in the request rather than link to an
+ * existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the
+ * template property, but not both.
*/
- @JsonProperty(value = "template")
private Object template;
/*
* The URI of the template. Use either the templateLink property or the template property, but not both.
*/
- @JsonProperty(value = "templateLink")
private DeploymentStacksTemplateLink templateLink;
/**
@@ -87,4 +92,45 @@ public void validate() {
templateLink().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeUntypedField("template", this.template);
+ jsonWriter.writeJsonField("templateLink", this.templateLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentStackTemplateDefinitionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentStackTemplateDefinitionInner 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 DeploymentStackTemplateDefinitionInner.
+ */
+ public static DeploymentStackTemplateDefinitionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentStackTemplateDefinitionInner deserializedDeploymentStackTemplateDefinitionInner
+ = new DeploymentStackTemplateDefinitionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("template".equals(fieldName)) {
+ deserializedDeploymentStackTemplateDefinitionInner.template = reader.readUntyped();
+ } else if ("templateLink".equals(fieldName)) {
+ deserializedDeploymentStackTemplateDefinitionInner.templateLink
+ = DeploymentStacksTemplateLink.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentStackTemplateDefinitionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java
index 0756a614c19d5..7f413898ec826 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java
@@ -5,10 +5,14 @@
package com.azure.resourcemanager.resources.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.management.SystemData;
import com.azure.core.management.exception.ManagementError;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.AzureResourceBase;
import com.azure.resourcemanager.resources.models.DeploymentStackValidateProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* The Deployment stack validation result.
@@ -18,15 +22,33 @@ public final class DeploymentStackValidateResultInner extends AzureResourceBase
/*
* The validation result details.
*/
- @JsonProperty(value = "properties")
private DeploymentStackValidateProperties properties;
/*
* The error detail.
*/
- @JsonProperty(value = "error")
private ManagementError error;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
/**
* Creates an instance of DeploymentStackValidateResultInner class.
*/
@@ -73,6 +95,46 @@ public DeploymentStackValidateResultInner withError(ManagementError error) {
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ @Override
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
/**
* Validates the instance.
*
@@ -85,4 +147,54 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeJsonField("error", this.error);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeploymentStackValidateResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentStackValidateResultInner 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 DeploymentStackValidateResultInner.
+ */
+ public static DeploymentStackValidateResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentStackValidateResultInner deserializedDeploymentStackValidateResultInner
+ = new DeploymentStackValidateResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.type = reader.getString();
+ } else if ("systemData".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.systemData = SystemData.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.properties
+ = DeploymentStackValidateProperties.fromJson(reader);
+ } else if ("error".equals(fieldName)) {
+ deserializedDeploymentStackValidateResultInner.error = ManagementError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentStackValidateResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java
index 30fc705a2c52f..56ccab7993f1b 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java
@@ -6,26 +6,26 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.DeploymentPropertiesExtended;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Information from validate template deployment response.
*/
@Fluent
-public final class DeploymentValidateResultInner {
+public final class DeploymentValidateResultInner implements JsonSerializable {
/*
- * Error Response
- *
* The deployment validation error.
*/
- @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY)
private ManagementError error;
/*
* The template deployment properties.
*/
- @JsonProperty(value = "properties")
private DeploymentPropertiesExtended properties;
/**
@@ -35,9 +35,7 @@ public DeploymentValidateResultInner() {
}
/**
- * Get the error property: Error Response
- *
- * The deployment validation error.
+ * Get the error property: The deployment validation error.
*
* @return the error value.
*/
@@ -75,4 +73,44 @@ 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 DeploymentValidateResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeploymentValidateResultInner 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 DeploymentValidateResultInner.
+ */
+ public static DeploymentValidateResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeploymentValidateResultInner deserializedDeploymentValidateResultInner
+ = new DeploymentValidateResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("error".equals(fieldName)) {
+ deserializedDeploymentValidateResultInner.error = ManagementError.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedDeploymentValidateResultInner.properties
+ = DeploymentPropertiesExtended.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeploymentValidateResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java
index 38ca19917bd7d..276bc7f01c134 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/FeatureResultInner.java
@@ -5,36 +5,36 @@
package com.azure.resourcemanager.resources.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.resources.models.FeatureProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Previewed feature information.
*/
@Fluent
-public final class FeatureResultInner {
+public final class FeatureResultInner implements JsonSerializable {
/*
* The name of the feature.
*/
- @JsonProperty(value = "name")
private String name;
/*
* Properties of the previewed feature.
*/
- @JsonProperty(value = "properties")
private FeatureProperties properties;
/*
* The resource ID of the feature.
*/
- @JsonProperty(value = "id")
private String id;
/*
* The resource type of the feature.
*/
- @JsonProperty(value = "type")
private String type;
/**
@@ -133,4 +133,49 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("id", this.id);
+ jsonWriter.writeStringField("type", this.type);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of FeatureResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of FeatureResultInner 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 FeatureResultInner.
+ */
+ public static FeatureResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ FeatureResultInner deserializedFeatureResultInner = new FeatureResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedFeatureResultInner.name = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedFeatureResultInner.properties = FeatureProperties.fromJson(reader);
+ } else if ("id".equals(fieldName)) {
+ deserializedFeatureResultInner.id = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedFeatureResultInner.type = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedFeatureResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java
index e8818b9b980ae..5f338b726a779 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java
@@ -5,11 +5,15 @@
package com.azure.resourcemanager.resources.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ExtendedLocation;
import com.azure.resourcemanager.resources.models.Identity;
import com.azure.resourcemanager.resources.models.Plan;
import com.azure.resourcemanager.resources.models.Sku;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;
@@ -21,21 +25,33 @@ public final class GenericResourceExpandedInner extends GenericResourceInner {
/*
* The created time of the resource. This is only present if requested via the $expand query parameter.
*/
- @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime createdTime;
/*
* The changed time of the resource. This is only present if requested via the $expand query parameter.
*/
- @JsonProperty(value = "changedTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime changedTime;
/*
* The provisioning state of the resource. This is only present if requested via the $expand query parameter.
*/
- @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private String provisioningState;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of GenericResourceExpandedInner class.
*/
@@ -72,6 +88,36 @@ public String provisioningState() {
return this.provisioningState;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* {@inheritDoc}
*/
@@ -162,4 +208,80 @@ public GenericResourceExpandedInner withTags(Map tags) {
public void validate() {
super.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("plan", plan());
+ jsonWriter.writeUntypedField("properties", properties());
+ jsonWriter.writeStringField("kind", kind());
+ jsonWriter.writeStringField("managedBy", managedBy());
+ jsonWriter.writeJsonField("sku", sku());
+ jsonWriter.writeJsonField("identity", identity());
+ jsonWriter.writeJsonField("extendedLocation", extendedLocation());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of GenericResourceExpandedInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of GenericResourceExpandedInner 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 GenericResourceExpandedInner.
+ */
+ public static GenericResourceExpandedInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ GenericResourceExpandedInner deserializedGenericResourceExpandedInner = new GenericResourceExpandedInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedGenericResourceExpandedInner.withTags(tags);
+ } else if ("plan".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withPlan(Plan.fromJson(reader));
+ } else if ("properties".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withProperties(reader.readUntyped());
+ } else if ("kind".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withKind(reader.getString());
+ } else if ("managedBy".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withManagedBy(reader.getString());
+ } else if ("sku".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withSku(Sku.fromJson(reader));
+ } else if ("identity".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withIdentity(Identity.fromJson(reader));
+ } else if ("extendedLocation".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.withExtendedLocation(ExtendedLocation.fromJson(reader));
+ } else if ("createdTime".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.createdTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("changedTime".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.changedTime = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedGenericResourceExpandedInner.provisioningState = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedGenericResourceExpandedInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java
index 9c8c1fe2df184..288368d0f9f8e 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java
@@ -6,11 +6,14 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ExtendedLocation;
import com.azure.resourcemanager.resources.models.Identity;
import com.azure.resourcemanager.resources.models.Plan;
import com.azure.resourcemanager.resources.models.Sku;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -21,45 +24,53 @@ public class GenericResourceInner extends Resource {
/*
* The plan of the resource.
*/
- @JsonProperty(value = "plan")
private Plan plan;
/*
* The resource properties.
*/
- @JsonProperty(value = "properties")
private Object properties;
/*
* The kind of the resource.
*/
- @JsonProperty(value = "kind")
private String kind;
/*
* ID of the resource that manages this resource.
*/
- @JsonProperty(value = "managedBy")
private String managedBy;
/*
* The SKU of the resource.
*/
- @JsonProperty(value = "sku")
private Sku sku;
/*
* The identity of the resource.
*/
- @JsonProperty(value = "identity")
private Identity identity;
/*
* Resource extended location.
*/
- @JsonProperty(value = "extendedLocation")
private ExtendedLocation extendedLocation;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of GenericResourceInner class.
*/
@@ -206,6 +217,36 @@ public GenericResourceInner withExtendedLocation(ExtendedLocation extendedLocati
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* {@inheritDoc}
*/
@@ -243,4 +284,72 @@ public void validate() {
extendedLocation().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("plan", this.plan);
+ jsonWriter.writeUntypedField("properties", this.properties);
+ jsonWriter.writeStringField("kind", this.kind);
+ jsonWriter.writeStringField("managedBy", this.managedBy);
+ jsonWriter.writeJsonField("sku", this.sku);
+ jsonWriter.writeJsonField("identity", this.identity);
+ jsonWriter.writeJsonField("extendedLocation", this.extendedLocation);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of GenericResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of GenericResourceInner 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 GenericResourceInner.
+ */
+ public static GenericResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ GenericResourceInner deserializedGenericResourceInner = new GenericResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedGenericResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedGenericResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedGenericResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedGenericResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedGenericResourceInner.withTags(tags);
+ } else if ("plan".equals(fieldName)) {
+ deserializedGenericResourceInner.plan = Plan.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedGenericResourceInner.properties = reader.readUntyped();
+ } else if ("kind".equals(fieldName)) {
+ deserializedGenericResourceInner.kind = reader.getString();
+ } else if ("managedBy".equals(fieldName)) {
+ deserializedGenericResourceInner.managedBy = reader.getString();
+ } else if ("sku".equals(fieldName)) {
+ deserializedGenericResourceInner.sku = Sku.fromJson(reader);
+ } else if ("identity".equals(fieldName)) {
+ deserializedGenericResourceInner.identity = Identity.fromJson(reader);
+ } else if ("extendedLocation".equals(fieldName)) {
+ deserializedGenericResourceInner.extendedLocation = ExtendedLocation.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedGenericResourceInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java
index e994887b9bf14..c346bef1be5a2 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java
@@ -5,63 +5,60 @@
package com.azure.resourcemanager.resources.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.resources.models.AvailabilityZoneMappings;
import com.azure.resourcemanager.resources.models.LocationMetadata;
import com.azure.resourcemanager.resources.models.LocationType;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Location information.
*/
@Fluent
-public final class LocationInner {
+public final class LocationInner implements JsonSerializable {
/*
- * The fully qualified ID of the location. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus.
+ * The fully qualified ID of the location. For example,
+ * /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus.
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The subscription ID.
*/
- @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY)
private String subscriptionId;
/*
* The location name.
*/
- @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
private String name;
/*
* The location type.
*/
- @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
private LocationType type;
/*
* The display name of the location.
*/
- @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
private String displayName;
/*
* The display name of the location and its region.
*/
- @JsonProperty(value = "regionalDisplayName", access = JsonProperty.Access.WRITE_ONLY)
private String regionalDisplayName;
/*
* Metadata of the location, such as lat/long, paired region, and others.
*/
- @JsonProperty(value = "metadata")
private LocationMetadata metadata;
/*
* The availability zone mappings for this region.
*/
- @JsonProperty(value = "availabilityZoneMappings")
private List availabilityZoneMappings;
/**
@@ -178,4 +175,58 @@ public void validate() {
availabilityZoneMappings().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("metadata", this.metadata);
+ jsonWriter.writeArrayField("availabilityZoneMappings", this.availabilityZoneMappings,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of LocationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of LocationInner 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 LocationInner.
+ */
+ public static LocationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ LocationInner deserializedLocationInner = new LocationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedLocationInner.id = reader.getString();
+ } else if ("subscriptionId".equals(fieldName)) {
+ deserializedLocationInner.subscriptionId = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedLocationInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedLocationInner.type = LocationType.fromString(reader.getString());
+ } else if ("displayName".equals(fieldName)) {
+ deserializedLocationInner.displayName = reader.getString();
+ } else if ("regionalDisplayName".equals(fieldName)) {
+ deserializedLocationInner.regionalDisplayName = reader.getString();
+ } else if ("metadata".equals(fieldName)) {
+ deserializedLocationInner.metadata = LocationMetadata.fromJson(reader);
+ } else if ("availabilityZoneMappings".equals(fieldName)) {
+ List availabilityZoneMappings
+ = reader.readArray(reader1 -> AvailabilityZoneMappings.fromJson(reader1));
+ deserializedLocationInner.availabilityZoneMappings = availabilityZoneMappings;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedLocationInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java
index e23dee97509c3..f51059a5e2434 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java
@@ -7,9 +7,12 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
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.resources.models.LockLevel;
import com.azure.resourcemanager.resources.models.ManagementLockOwner;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
@@ -20,9 +23,23 @@ public final class ManagementLockObjectInner extends ProxyResource {
/*
* The properties of the lock.
*/
- @JsonProperty(value = "properties", required = true)
private ManagementLockProperties innerProperties = new ManagementLockProperties();
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of ManagementLockObjectInner class.
*/
@@ -38,6 +55,36 @@ private ManagementLockProperties innerProperties() {
return this.innerProperties;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly.
* CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means
@@ -127,4 +174,47 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(ManagementLockObjectInner.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ManagementLockObjectInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ManagementLockObjectInner 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 ManagementLockObjectInner.
+ */
+ public static ManagementLockObjectInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ManagementLockObjectInner deserializedManagementLockObjectInner = new ManagementLockObjectInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedManagementLockObjectInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedManagementLockObjectInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedManagementLockObjectInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedManagementLockObjectInner.innerProperties = ManagementLockProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedManagementLockObjectInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java
index 57b92f3f37307..8c677f21a0b31 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java
@@ -6,32 +6,35 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.LockLevel;
import com.azure.resourcemanager.resources.models.ManagementLockOwner;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* The lock properties.
*/
@Fluent
-public final class ManagementLockProperties {
+public final class ManagementLockProperties implements JsonSerializable {
/*
- * The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
+ * The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized
+ * users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read
+ * from a resource, but they can't modify or delete it.
*/
- @JsonProperty(value = "level", required = true)
private LockLevel level;
/*
* Notes about the lock. Maximum of 512 characters.
*/
- @JsonProperty(value = "notes")
private String notes;
/*
* The owners of the lock.
*/
- @JsonProperty(value = "owners")
private List owners;
/**
@@ -120,4 +123,49 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(ManagementLockProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString());
+ jsonWriter.writeStringField("notes", this.notes);
+ jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ManagementLockProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ManagementLockProperties 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 ManagementLockProperties.
+ */
+ public static ManagementLockProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ManagementLockProperties deserializedManagementLockProperties = new ManagementLockProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("level".equals(fieldName)) {
+ deserializedManagementLockProperties.level = LockLevel.fromString(reader.getString());
+ } else if ("notes".equals(fieldName)) {
+ deserializedManagementLockProperties.notes = reader.getString();
+ } else if ("owners".equals(fieldName)) {
+ List owners
+ = reader.readArray(reader1 -> ManagementLockOwner.fromJson(reader1));
+ deserializedManagementLockProperties.owners = owners;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedManagementLockProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java
index d43ef8be20160..3c3798e29244c 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java
@@ -5,24 +5,26 @@
package com.azure.resourcemanager.resources.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.resources.models.OperationDisplay;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Microsoft.Resources operation.
*/
@Fluent
-public final class OperationInner {
+public final class OperationInner implements JsonSerializable {
/*
* Operation name: {provider}/{resource}/{operation}
*/
- @JsonProperty(value = "name")
private String name;
/*
* The object that represents the operation.
*/
- @JsonProperty(value = "display")
private OperationDisplay display;
/**
@@ -81,4 +83,43 @@ public void validate() {
display().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java
index 1a72216d5fd50..fd256c39cdde2 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java
@@ -7,13 +7,16 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.EnforcementMode;
import com.azure.resourcemanager.resources.models.Identity;
import com.azure.resourcemanager.resources.models.NonComplianceMessage;
import com.azure.resourcemanager.resources.models.OverrideModel;
import com.azure.resourcemanager.resources.models.ParameterValuesValue;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -25,27 +28,38 @@ public final class PolicyAssignmentInner extends ProxyResource {
/*
* Properties for the policy assignment.
*/
- @JsonProperty(value = "properties")
private PolicyAssignmentProperties innerProperties;
/*
* The location of the policy assignment. Only required when utilizing managed identity.
*/
- @JsonProperty(value = "location")
private String location;
/*
* The managed identity associated with the policy assignment.
*/
- @JsonProperty(value = "identity")
private Identity identity;
/*
* The system metadata relating to this resource.
*/
- @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of PolicyAssignmentInner class.
*/
@@ -110,6 +124,36 @@ public SystemData systemData() {
return this.systemData;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the displayName property: The display name of the policy assignment.
*
@@ -368,4 +412,55 @@ public void validate() {
identity().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ jsonWriter.writeStringField("location", this.location);
+ jsonWriter.writeJsonField("identity", this.identity);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyAssignmentInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyAssignmentInner 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 PolicyAssignmentInner.
+ */
+ public static PolicyAssignmentInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyAssignmentInner deserializedPolicyAssignmentInner = new PolicyAssignmentInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.innerProperties = PolicyAssignmentProperties.fromJson(reader);
+ } else if ("location".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.location = reader.getString();
+ } else if ("identity".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.identity = Identity.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPolicyAssignmentInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyAssignmentInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java
index 5a88d4274ea3a..1d23bee8f077f 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java
@@ -5,13 +5,16 @@
package com.azure.resourcemanager.resources.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.resources.models.EnforcementMode;
import com.azure.resourcemanager.resources.models.NonComplianceMessage;
import com.azure.resourcemanager.resources.models.OverrideModel;
import com.azure.resourcemanager.resources.models.ParameterValuesValue;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -19,72 +22,61 @@
* The policy assignment properties.
*/
@Fluent
-public final class PolicyAssignmentProperties {
+public final class PolicyAssignmentProperties implements JsonSerializable {
/*
* The display name of the policy assignment.
*/
- @JsonProperty(value = "displayName")
private String displayName;
/*
* The ID of the policy definition or policy set definition being assigned.
*/
- @JsonProperty(value = "policyDefinitionId")
private String policyDefinitionId;
/*
* The scope for the policy assignment.
*/
- @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY)
private String scope;
/*
* The policy's excluded scopes.
*/
- @JsonProperty(value = "notScopes")
private List notScopes;
/*
* The parameter values for the assigned policy rule. The keys are the parameter names.
*/
- @JsonProperty(value = "parameters")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map parameters;
/*
* This message will be part of response in case of policy violation.
*/
- @JsonProperty(value = "description")
private String description;
/*
- * The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
+ * The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value
+ * pairs.
*/
- @JsonProperty(value = "metadata")
private Object metadata;
/*
* The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
*/
- @JsonProperty(value = "enforcementMode")
private EnforcementMode enforcementMode;
/*
* The messages that describe why a resource is non-compliant with the policy.
*/
- @JsonProperty(value = "nonComplianceMessages")
private List nonComplianceMessages;
/*
* The resource selector list to filter policies by resource properties.
*/
- @JsonProperty(value = "resourceSelectors")
private List resourceSelectors;
/*
* The policy property value override.
*/
- @JsonProperty(value = "overrides")
private List overrides;
/**
@@ -331,4 +323,81 @@ public void validate() {
overrides().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("policyDefinitionId", this.policyDefinitionId);
+ jsonWriter.writeArrayField("notScopes", this.notScopes, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeUntypedField("metadata", this.metadata);
+ jsonWriter.writeStringField("enforcementMode",
+ this.enforcementMode == null ? null : this.enforcementMode.toString());
+ jsonWriter.writeArrayField("nonComplianceMessages", this.nonComplianceMessages,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("resourceSelectors", this.resourceSelectors,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyAssignmentProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyAssignmentProperties 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 PolicyAssignmentProperties.
+ */
+ public static PolicyAssignmentProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyAssignmentProperties deserializedPolicyAssignmentProperties = new PolicyAssignmentProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("displayName".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.displayName = reader.getString();
+ } else if ("policyDefinitionId".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.policyDefinitionId = reader.getString();
+ } else if ("scope".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.scope = reader.getString();
+ } else if ("notScopes".equals(fieldName)) {
+ List notScopes = reader.readArray(reader1 -> reader1.getString());
+ deserializedPolicyAssignmentProperties.notScopes = notScopes;
+ } else if ("parameters".equals(fieldName)) {
+ Map parameters
+ = reader.readMap(reader1 -> ParameterValuesValue.fromJson(reader1));
+ deserializedPolicyAssignmentProperties.parameters = parameters;
+ } else if ("description".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.description = reader.getString();
+ } else if ("metadata".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.metadata = reader.readUntyped();
+ } else if ("enforcementMode".equals(fieldName)) {
+ deserializedPolicyAssignmentProperties.enforcementMode
+ = EnforcementMode.fromString(reader.getString());
+ } else if ("nonComplianceMessages".equals(fieldName)) {
+ List nonComplianceMessages
+ = reader.readArray(reader1 -> NonComplianceMessage.fromJson(reader1));
+ deserializedPolicyAssignmentProperties.nonComplianceMessages = nonComplianceMessages;
+ } else if ("resourceSelectors".equals(fieldName)) {
+ List resourceSelectors
+ = reader.readArray(reader1 -> ResourceSelector.fromJson(reader1));
+ deserializedPolicyAssignmentProperties.resourceSelectors = resourceSelectors;
+ } else if ("overrides".equals(fieldName)) {
+ List overrides = reader.readArray(reader1 -> OverrideModel.fromJson(reader1));
+ deserializedPolicyAssignmentProperties.overrides = overrides;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyAssignmentProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java
index 29aebcad34ddf..d626b336c1975 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java
@@ -5,26 +5,28 @@
package com.azure.resourcemanager.resources.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.resources.models.OverrideModel;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* The policy assignment properties for Patch request.
*/
@Fluent
-public final class PolicyAssignmentUpdateProperties {
+public final class PolicyAssignmentUpdateProperties implements JsonSerializable {
/*
* The resource selector list to filter policies by resource properties.
*/
- @JsonProperty(value = "resourceSelectors")
private List resourceSelectors;
/*
* The policy property value override.
*/
- @JsonProperty(value = "overrides")
private List overrides;
/**
@@ -86,4 +88,48 @@ public void validate() {
overrides().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceSelectors", this.resourceSelectors,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyAssignmentUpdateProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyAssignmentUpdateProperties 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 PolicyAssignmentUpdateProperties.
+ */
+ public static PolicyAssignmentUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyAssignmentUpdateProperties deserializedPolicyAssignmentUpdateProperties
+ = new PolicyAssignmentUpdateProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceSelectors".equals(fieldName)) {
+ List resourceSelectors
+ = reader.readArray(reader1 -> ResourceSelector.fromJson(reader1));
+ deserializedPolicyAssignmentUpdateProperties.resourceSelectors = resourceSelectors;
+ } else if ("overrides".equals(fieldName)) {
+ List overrides = reader.readArray(reader1 -> OverrideModel.fromJson(reader1));
+ deserializedPolicyAssignmentUpdateProperties.overrides = overrides;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyAssignmentUpdateProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java
index 6a1f249b10259..9ac54d52d6aa1 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java
@@ -7,9 +7,12 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ParameterDefinitionsValue;
import com.azure.resourcemanager.resources.models.PolicyType;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -20,15 +23,28 @@ public final class PolicyDefinitionInner extends ProxyResource {
/*
* The policy definition properties.
*/
- @JsonProperty(value = "properties")
private PolicyDefinitionProperties innerProperties;
/*
* The system metadata relating to this resource.
*/
- @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of PolicyDefinitionInner class.
*/
@@ -53,6 +69,36 @@ public SystemData systemData() {
return this.systemData;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom,
* and Static.
@@ -230,4 +276,49 @@ 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 PolicyDefinitionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyDefinitionInner 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 PolicyDefinitionInner.
+ */
+ public static PolicyDefinitionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyDefinitionInner deserializedPolicyDefinitionInner = new PolicyDefinitionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPolicyDefinitionInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPolicyDefinitionInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPolicyDefinitionInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPolicyDefinitionInner.innerProperties = PolicyDefinitionProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPolicyDefinitionInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyDefinitionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java
index a1eeeefad3fd2..f1ee56a94f653 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java
@@ -5,58 +5,54 @@
package com.azure.resourcemanager.resources.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.resources.models.ParameterDefinitionsValue;
import com.azure.resourcemanager.resources.models.PolicyType;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
* The policy definition properties.
*/
@Fluent
-public final class PolicyDefinitionProperties {
+public final class PolicyDefinitionProperties implements JsonSerializable {
/*
* The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.
*/
- @JsonProperty(value = "policyType")
private PolicyType policyType;
/*
* The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data.
*/
- @JsonProperty(value = "mode")
private String mode;
/*
* The display name of the policy definition.
*/
- @JsonProperty(value = "displayName")
private String displayName;
/*
* The policy definition description.
*/
- @JsonProperty(value = "description")
private String description;
/*
* The policy rule.
*/
- @JsonProperty(value = "policyRule")
private Object policyRule;
/*
- * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs.
+ * The policy definition metadata. Metadata is an open ended object and is typically a collection of key value
+ * pairs.
*/
- @JsonProperty(value = "metadata")
private Object metadata;
/*
* The parameter definitions for parameters used in the policy rule. The keys are the parameter names.
*/
- @JsonProperty(value = "parameters")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map parameters;
/**
@@ -225,4 +221,60 @@ public void validate() {
});
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString());
+ jsonWriter.writeStringField("mode", this.mode);
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeUntypedField("policyRule", this.policyRule);
+ jsonWriter.writeUntypedField("metadata", this.metadata);
+ jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyDefinitionProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyDefinitionProperties 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 PolicyDefinitionProperties.
+ */
+ public static PolicyDefinitionProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyDefinitionProperties deserializedPolicyDefinitionProperties = new PolicyDefinitionProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("policyType".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.policyType = PolicyType.fromString(reader.getString());
+ } else if ("mode".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.mode = reader.getString();
+ } else if ("displayName".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.displayName = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.description = reader.getString();
+ } else if ("policyRule".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.policyRule = reader.readUntyped();
+ } else if ("metadata".equals(fieldName)) {
+ deserializedPolicyDefinitionProperties.metadata = reader.readUntyped();
+ } else if ("parameters".equals(fieldName)) {
+ Map parameters
+ = reader.readMap(reader1 -> ParameterDefinitionsValue.fromJson(reader1));
+ deserializedPolicyDefinitionProperties.parameters = parameters;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyDefinitionProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java
index 17683dee0cba8..8369bb495b8c5 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java
@@ -8,10 +8,13 @@
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.AssignmentScopeValidation;
import com.azure.resourcemanager.resources.models.ExemptionCategory;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
@@ -23,15 +26,28 @@ public final class PolicyExemptionInner extends ProxyResource {
/*
* Properties for the policy exemption.
*/
- @JsonProperty(value = "properties", required = true)
private PolicyExemptionProperties innerProperties = new PolicyExemptionProperties();
/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
- @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of PolicyExemptionInner class.
*/
@@ -56,6 +72,36 @@ public SystemData systemData() {
return this.systemData;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the policyAssignmentId property: The ID of the policy assignment that is being exempted.
*
@@ -287,4 +333,49 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(PolicyExemptionInner.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyExemptionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyExemptionInner 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 PolicyExemptionInner.
+ */
+ public static PolicyExemptionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyExemptionInner deserializedPolicyExemptionInner = new PolicyExemptionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPolicyExemptionInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPolicyExemptionInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPolicyExemptionInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPolicyExemptionInner.innerProperties = PolicyExemptionProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPolicyExemptionInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyExemptionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java
index 7f0b19bffb8c1..5b6bf4e718202 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java
@@ -5,71 +5,69 @@
package com.azure.resourcemanager.resources.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.AssignmentScopeValidation;
import com.azure.resourcemanager.resources.models.ExemptionCategory;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* The policy exemption properties.
*/
@Fluent
-public final class PolicyExemptionProperties {
+public final class PolicyExemptionProperties implements JsonSerializable {
/*
* The ID of the policy assignment that is being exempted.
*/
- @JsonProperty(value = "policyAssignmentId", required = true)
private String policyAssignmentId;
/*
- * The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition.
+ * The policy definition reference ID list when the associated policy assignment is an assignment of a policy set
+ * definition.
*/
- @JsonProperty(value = "policyDefinitionReferenceIds")
private List policyDefinitionReferenceIds;
/*
* The policy exemption category. Possible values are Waiver and Mitigated.
*/
- @JsonProperty(value = "exemptionCategory", required = true)
private ExemptionCategory exemptionCategory;
/*
* The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption.
*/
- @JsonProperty(value = "expiresOn")
private OffsetDateTime expiresOn;
/*
* The display name of the policy exemption.
*/
- @JsonProperty(value = "displayName")
private String displayName;
/*
* The description of the policy exemption.
*/
- @JsonProperty(value = "description")
private String description;
/*
* The policy exemption metadata. Metadata is an open ended object and is typically a collection of key value pairs.
*/
- @JsonProperty(value = "metadata")
private Object metadata;
/*
* The resource selector list to filter policies by resource properties.
*/
- @JsonProperty(value = "resourceSelectors")
private List resourceSelectors;
/*
* The option whether validate the exemption is at or under the assignment scope.
*/
- @JsonProperty(value = "assignmentScopeValidation")
private AssignmentScopeValidation assignmentScopeValidation;
/**
@@ -289,4 +287,76 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(PolicyExemptionProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("policyAssignmentId", this.policyAssignmentId);
+ jsonWriter.writeStringField("exemptionCategory",
+ this.exemptionCategory == null ? null : this.exemptionCategory.toString());
+ jsonWriter.writeArrayField("policyDefinitionReferenceIds", this.policyDefinitionReferenceIds,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("expiresOn",
+ this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn));
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeUntypedField("metadata", this.metadata);
+ jsonWriter.writeArrayField("resourceSelectors", this.resourceSelectors,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("assignmentScopeValidation",
+ this.assignmentScopeValidation == null ? null : this.assignmentScopeValidation.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyExemptionProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyExemptionProperties 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 PolicyExemptionProperties.
+ */
+ public static PolicyExemptionProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyExemptionProperties deserializedPolicyExemptionProperties = new PolicyExemptionProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("policyAssignmentId".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.policyAssignmentId = reader.getString();
+ } else if ("exemptionCategory".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.exemptionCategory
+ = ExemptionCategory.fromString(reader.getString());
+ } else if ("policyDefinitionReferenceIds".equals(fieldName)) {
+ List policyDefinitionReferenceIds = reader.readArray(reader1 -> reader1.getString());
+ deserializedPolicyExemptionProperties.policyDefinitionReferenceIds = policyDefinitionReferenceIds;
+ } else if ("expiresOn".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.expiresOn = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("displayName".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.displayName = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.description = reader.getString();
+ } else if ("metadata".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.metadata = reader.readUntyped();
+ } else if ("resourceSelectors".equals(fieldName)) {
+ List resourceSelectors
+ = reader.readArray(reader1 -> ResourceSelector.fromJson(reader1));
+ deserializedPolicyExemptionProperties.resourceSelectors = resourceSelectors;
+ } else if ("assignmentScopeValidation".equals(fieldName)) {
+ deserializedPolicyExemptionProperties.assignmentScopeValidation
+ = AssignmentScopeValidation.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyExemptionProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java
index 1d6005d08a69c..028b91e7c67e3 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java
@@ -5,26 +5,28 @@
package com.azure.resourcemanager.resources.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.resources.models.AssignmentScopeValidation;
import com.azure.resourcemanager.resources.models.ResourceSelector;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* The policy exemption properties for Patch request.
*/
@Fluent
-public final class PolicyExemptionUpdateProperties {
+public final class PolicyExemptionUpdateProperties implements JsonSerializable {
/*
* The resource selector list to filter policies by resource properties.
*/
- @JsonProperty(value = "resourceSelectors")
private List resourceSelectors;
/*
* The option whether validate the exemption is at or under the assignment scope.
*/
- @JsonProperty(value = "assignmentScopeValidation")
private AssignmentScopeValidation assignmentScopeValidation;
/**
@@ -86,4 +88,49 @@ public void validate() {
resourceSelectors().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("resourceSelectors", this.resourceSelectors,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("assignmentScopeValidation",
+ this.assignmentScopeValidation == null ? null : this.assignmentScopeValidation.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicyExemptionUpdateProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicyExemptionUpdateProperties 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 PolicyExemptionUpdateProperties.
+ */
+ public static PolicyExemptionUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicyExemptionUpdateProperties deserializedPolicyExemptionUpdateProperties
+ = new PolicyExemptionUpdateProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("resourceSelectors".equals(fieldName)) {
+ List resourceSelectors
+ = reader.readArray(reader1 -> ResourceSelector.fromJson(reader1));
+ deserializedPolicyExemptionUpdateProperties.resourceSelectors = resourceSelectors;
+ } else if ("assignmentScopeValidation".equals(fieldName)) {
+ deserializedPolicyExemptionUpdateProperties.assignmentScopeValidation
+ = AssignmentScopeValidation.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicyExemptionUpdateProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java
index 9fce0186a8d53..681c95756a26a 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java
@@ -7,11 +7,14 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ParameterDefinitionsValue;
import com.azure.resourcemanager.resources.models.PolicyDefinitionGroup;
import com.azure.resourcemanager.resources.models.PolicyDefinitionReference;
import com.azure.resourcemanager.resources.models.PolicyType;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -23,15 +26,28 @@ public final class PolicySetDefinitionInner extends ProxyResource {
/*
* The policy definition properties.
*/
- @JsonProperty(value = "properties")
private PolicySetDefinitionProperties innerProperties;
/*
* The system metadata relating to this resource.
*/
- @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of PolicySetDefinitionInner class.
*/
@@ -56,6 +72,36 @@ public SystemData systemData() {
return this.systemData;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom,
* and Static.
@@ -235,4 +281,50 @@ 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 PolicySetDefinitionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicySetDefinitionInner 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 PolicySetDefinitionInner.
+ */
+ public static PolicySetDefinitionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicySetDefinitionInner deserializedPolicySetDefinitionInner = new PolicySetDefinitionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPolicySetDefinitionInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPolicySetDefinitionInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPolicySetDefinitionInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPolicySetDefinitionInner.innerProperties
+ = PolicySetDefinitionProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPolicySetDefinitionInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicySetDefinitionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java
index cbcc4b82cf01b..1ee84b6c138c2 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java
@@ -6,12 +6,15 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ParameterDefinitionsValue;
import com.azure.resourcemanager.resources.models.PolicyDefinitionGroup;
import com.azure.resourcemanager.resources.models.PolicyDefinitionReference;
import com.azure.resourcemanager.resources.models.PolicyType;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -19,48 +22,41 @@
* The policy set definition properties.
*/
@Fluent
-public final class PolicySetDefinitionProperties {
+public final class PolicySetDefinitionProperties implements JsonSerializable {
/*
* The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.
*/
- @JsonProperty(value = "policyType")
private PolicyType policyType;
/*
* The display name of the policy set definition.
*/
- @JsonProperty(value = "displayName")
private String displayName;
/*
* The policy set definition description.
*/
- @JsonProperty(value = "description")
private String description;
/*
- * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs.
+ * The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value
+ * pairs.
*/
- @JsonProperty(value = "metadata")
private Object metadata;
/*
* The policy set definition parameters that can be used in policy definition references.
*/
- @JsonProperty(value = "parameters")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map parameters;
/*
* An array of policy definition references.
*/
- @JsonProperty(value = "policyDefinitions", required = true)
private List policyDefinitions;
/*
* The metadata describing groups of policy definition references within the policy set definition.
*/
- @JsonProperty(value = "policyDefinitionGroups")
private List policyDefinitionGroups;
/**
@@ -244,4 +240,68 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(PolicySetDefinitionProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("policyDefinitions", this.policyDefinitions,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString());
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("description", this.description);
+ jsonWriter.writeUntypedField("metadata", this.metadata);
+ jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("policyDefinitionGroups", this.policyDefinitionGroups,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PolicySetDefinitionProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PolicySetDefinitionProperties 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 PolicySetDefinitionProperties.
+ */
+ public static PolicySetDefinitionProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PolicySetDefinitionProperties deserializedPolicySetDefinitionProperties
+ = new PolicySetDefinitionProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("policyDefinitions".equals(fieldName)) {
+ List policyDefinitions
+ = reader.readArray(reader1 -> PolicyDefinitionReference.fromJson(reader1));
+ deserializedPolicySetDefinitionProperties.policyDefinitions = policyDefinitions;
+ } else if ("policyType".equals(fieldName)) {
+ deserializedPolicySetDefinitionProperties.policyType = PolicyType.fromString(reader.getString());
+ } else if ("displayName".equals(fieldName)) {
+ deserializedPolicySetDefinitionProperties.displayName = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedPolicySetDefinitionProperties.description = reader.getString();
+ } else if ("metadata".equals(fieldName)) {
+ deserializedPolicySetDefinitionProperties.metadata = reader.readUntyped();
+ } else if ("parameters".equals(fieldName)) {
+ Map parameters
+ = reader.readMap(reader1 -> ParameterDefinitionsValue.fromJson(reader1));
+ deserializedPolicySetDefinitionProperties.parameters = parameters;
+ } else if ("policyDefinitionGroups".equals(fieldName)) {
+ List policyDefinitionGroups
+ = reader.readArray(reader1 -> PolicyDefinitionGroup.fromJson(reader1));
+ deserializedPolicySetDefinitionProperties.policyDefinitionGroups = policyDefinitionGroups;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPolicySetDefinitionProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java
index 723022bf80ef2..db64afa5ce6c3 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java
@@ -5,50 +5,48 @@
package com.azure.resourcemanager.resources.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.resources.models.ProviderAuthorizationConsentState;
import com.azure.resourcemanager.resources.models.ProviderResourceType;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Resource provider information.
*/
@Fluent
-public final class ProviderInner {
+public final class ProviderInner implements JsonSerializable {
/*
* The provider ID.
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The namespace of the resource provider.
*/
- @JsonProperty(value = "namespace")
private String namespace;
/*
* The registration state of the resource provider.
*/
- @JsonProperty(value = "registrationState", access = JsonProperty.Access.WRITE_ONLY)
private String registrationState;
/*
* The registration policy of the resource provider.
*/
- @JsonProperty(value = "registrationPolicy", access = JsonProperty.Access.WRITE_ONLY)
private String registrationPolicy;
/*
* The collection of provider resource types.
*/
- @JsonProperty(value = "resourceTypes", access = JsonProperty.Access.WRITE_ONLY)
private List resourceTypes;
/*
* The provider authorization consent state.
*/
- @JsonProperty(value = "providerAuthorizationConsentState")
private ProviderAuthorizationConsentState providerAuthorizationConsentState;
/**
@@ -144,4 +142,55 @@ public void validate() {
resourceTypes().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("namespace", this.namespace);
+ jsonWriter.writeStringField("providerAuthorizationConsentState",
+ this.providerAuthorizationConsentState == null ? null : this.providerAuthorizationConsentState.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProviderInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProviderInner 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 ProviderInner.
+ */
+ public static ProviderInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProviderInner deserializedProviderInner = new ProviderInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedProviderInner.id = reader.getString();
+ } else if ("namespace".equals(fieldName)) {
+ deserializedProviderInner.namespace = reader.getString();
+ } else if ("registrationState".equals(fieldName)) {
+ deserializedProviderInner.registrationState = reader.getString();
+ } else if ("registrationPolicy".equals(fieldName)) {
+ deserializedProviderInner.registrationPolicy = reader.getString();
+ } else if ("resourceTypes".equals(fieldName)) {
+ List resourceTypes
+ = reader.readArray(reader1 -> ProviderResourceType.fromJson(reader1));
+ deserializedProviderInner.resourceTypes = resourceTypes;
+ } else if ("providerAuthorizationConsentState".equals(fieldName)) {
+ deserializedProviderInner.providerAuthorizationConsentState
+ = ProviderAuthorizationConsentState.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProviderInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java
index d98aa6e0965ac..430a6c05f0e30 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java
@@ -5,25 +5,27 @@
package com.azure.resourcemanager.resources.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.resources.models.ProviderPermission;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* List of provider permissions.
*/
@Fluent
-public final class ProviderPermissionListResultInner {
+public final class ProviderPermissionListResultInner implements JsonSerializable {
/*
* An array of provider permissions.
*/
- @JsonProperty(value = "value")
private List value;
/*
* The URL to use for getting the next set of results.
*/
- @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY)
private String nextLink;
/**
@@ -71,4 +73,44 @@ 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 ProviderPermissionListResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProviderPermissionListResultInner 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 ProviderPermissionListResultInner.
+ */
+ public static ProviderPermissionListResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProviderPermissionListResultInner deserializedProviderPermissionListResultInner
+ = new ProviderPermissionListResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> ProviderPermission.fromJson(reader1));
+ deserializedProviderPermissionListResultInner.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedProviderPermissionListResultInner.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProviderPermissionListResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java
index 6aedeb43970ee..1ca79f7c7cac0 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java
@@ -5,25 +5,28 @@
package com.azure.resourcemanager.resources.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.resources.models.ProviderResourceType;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* List of resource types of a resource provider.
*/
@Fluent
-public final class ProviderResourceTypeListResultInner {
+public final class ProviderResourceTypeListResultInner
+ implements JsonSerializable {
/*
* An array of resource types.
*/
- @JsonProperty(value = "value")
private List value;
/*
* The URL to use for getting the next set of results.
*/
- @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY)
private String nextLink;
/**
@@ -71,4 +74,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));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ProviderResourceTypeListResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ProviderResourceTypeListResultInner 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 ProviderResourceTypeListResultInner.
+ */
+ public static ProviderResourceTypeListResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ProviderResourceTypeListResultInner deserializedProviderResourceTypeListResultInner
+ = new ProviderResourceTypeListResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value
+ = reader.readArray(reader1 -> ProviderResourceType.fromJson(reader1));
+ deserializedProviderResourceTypeListResultInner.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedProviderResourceTypeListResultInner.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedProviderResourceTypeListResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java
index 4c25cf3bf6831..a61b19da05963 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java
@@ -6,31 +6,30 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
-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 group export result.
*/
@Fluent
-public final class ResourceGroupExportResultInner {
+public final class ResourceGroupExportResultInner implements JsonSerializable {
/*
* The template content. Used if outputFormat is empty or set to 'Json'.
*/
- @JsonProperty(value = "template")
private Object template;
/*
* The formatted export content. Used if outputFormat is set to 'Bicep'.
*/
- @JsonProperty(value = "output")
private String output;
/*
- * Error Response
- *
* The template export error.
*/
- @JsonProperty(value = "error")
private ManagementError error;
/**
@@ -80,9 +79,7 @@ public ResourceGroupExportResultInner withOutput(String output) {
}
/**
- * Get the error property: Error Response
- *
- * The template export error.
+ * Get the error property: The template export error.
*
* @return the error value.
*/
@@ -91,9 +88,7 @@ public ManagementError error() {
}
/**
- * Set the error property: Error Response
- *
- * The template export error.
+ * Set the error property: The template export error.
*
* @param error the error value to set.
* @return the ResourceGroupExportResultInner object itself.
@@ -110,4 +105,47 @@ public ResourceGroupExportResultInner withError(ManagementError error) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeUntypedField("template", this.template);
+ jsonWriter.writeStringField("output", this.output);
+ jsonWriter.writeJsonField("error", this.error);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceGroupExportResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceGroupExportResultInner 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 ResourceGroupExportResultInner.
+ */
+ public static ResourceGroupExportResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceGroupExportResultInner deserializedResourceGroupExportResultInner
+ = new ResourceGroupExportResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("template".equals(fieldName)) {
+ deserializedResourceGroupExportResultInner.template = reader.readUntyped();
+ } else if ("output".equals(fieldName)) {
+ deserializedResourceGroupExportResultInner.output = reader.getString();
+ } else if ("error".equals(fieldName)) {
+ deserializedResourceGroupExportResultInner.error = ManagementError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceGroupExportResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java
index 14bdbfdd07666..940ace373c3e7 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java
@@ -6,8 +6,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.ResourceGroupProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.Map;
/**
@@ -18,15 +21,28 @@ public final class ResourceGroupInner extends Resource {
/*
* The resource group properties.
*/
- @JsonProperty(value = "properties")
private ResourceGroupProperties properties;
/*
* The ID of the resource that manages this resource group.
*/
- @JsonProperty(value = "managedBy")
private String managedBy;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of ResourceGroupInner class.
*/
@@ -73,6 +89,36 @@ public ResourceGroupInner withManagedBy(String managedBy) {
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* {@inheritDoc}
*/
@@ -101,4 +147,57 @@ public void validate() {
properties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeStringField("managedBy", this.managedBy);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceGroupInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceGroupInner 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 ResourceGroupInner.
+ */
+ public static ResourceGroupInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceGroupInner deserializedResourceGroupInner = new ResourceGroupInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedResourceGroupInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedResourceGroupInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedResourceGroupInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedResourceGroupInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedResourceGroupInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedResourceGroupInner.properties = ResourceGroupProperties.fromJson(reader);
+ } else if ("managedBy".equals(fieldName)) {
+ deserializedResourceGroupInner.managedBy = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceGroupInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionFeatureRegistrationInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionFeatureRegistrationInner.java
index 8fb91c3052e4c..0a57c5fbb7117 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionFeatureRegistrationInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionFeatureRegistrationInner.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.resources.models.SubscriptionFeatureRegistrationProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Subscription feature registration details.
@@ -17,9 +20,23 @@ public final class SubscriptionFeatureRegistrationInner extends ProxyResource {
/*
* The properties property.
*/
- @JsonProperty(value = "properties")
private SubscriptionFeatureRegistrationProperties properties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of SubscriptionFeatureRegistrationInner class.
*/
@@ -46,6 +63,36 @@ public SubscriptionFeatureRegistrationInner withProperties(SubscriptionFeatureRe
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Validates the instance.
*
@@ -56,4 +103,49 @@ 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 SubscriptionFeatureRegistrationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SubscriptionFeatureRegistrationInner 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 SubscriptionFeatureRegistrationInner.
+ */
+ public static SubscriptionFeatureRegistrationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SubscriptionFeatureRegistrationInner deserializedSubscriptionFeatureRegistrationInner
+ = new SubscriptionFeatureRegistrationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedSubscriptionFeatureRegistrationInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedSubscriptionFeatureRegistrationInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedSubscriptionFeatureRegistrationInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedSubscriptionFeatureRegistrationInner.properties
+ = SubscriptionFeatureRegistrationProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSubscriptionFeatureRegistrationInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java
index 894033753a85a..767c245c576c8 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java
@@ -5,11 +5,14 @@
package com.azure.resourcemanager.resources.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.resources.models.ManagedByTenant;
import com.azure.resourcemanager.resources.models.SubscriptionPolicies;
import com.azure.resourcemanager.resources.models.SubscriptionState;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -17,60 +20,51 @@
* Subscription information.
*/
@Fluent
-public final class SubscriptionInner {
+public final class SubscriptionInner implements JsonSerializable {
/*
* The fully qualified ID for the subscription. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The subscription ID.
*/
- @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY)
private String subscriptionId;
/*
* The subscription display name.
*/
- @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
private String displayName;
/*
* The subscription tenant ID.
*/
- @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
private String tenantId;
/*
* The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
*/
- @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY)
private SubscriptionState state;
/*
* The subscription policies.
*/
- @JsonProperty(value = "subscriptionPolicies")
private SubscriptionPolicies subscriptionPolicies;
/*
- * The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
+ * The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased,
+ * Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
*/
- @JsonProperty(value = "authorizationSource")
private String authorizationSource;
/*
* An array containing the tenants managing the subscription.
*/
- @JsonProperty(value = "managedByTenants")
private List managedByTenants;
/*
* The tags attached to the subscription.
*/
- @JsonProperty(value = "tags")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map tags;
/**
@@ -221,4 +215,63 @@ public void validate() {
managedByTenants().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("subscriptionPolicies", this.subscriptionPolicies);
+ jsonWriter.writeStringField("authorizationSource", this.authorizationSource);
+ jsonWriter.writeArrayField("managedByTenants", this.managedByTenants,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of SubscriptionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SubscriptionInner 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 SubscriptionInner.
+ */
+ public static SubscriptionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SubscriptionInner deserializedSubscriptionInner = new SubscriptionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedSubscriptionInner.id = reader.getString();
+ } else if ("subscriptionId".equals(fieldName)) {
+ deserializedSubscriptionInner.subscriptionId = reader.getString();
+ } else if ("displayName".equals(fieldName)) {
+ deserializedSubscriptionInner.displayName = reader.getString();
+ } else if ("tenantId".equals(fieldName)) {
+ deserializedSubscriptionInner.tenantId = reader.getString();
+ } else if ("state".equals(fieldName)) {
+ deserializedSubscriptionInner.state = SubscriptionState.fromString(reader.getString());
+ } else if ("subscriptionPolicies".equals(fieldName)) {
+ deserializedSubscriptionInner.subscriptionPolicies = SubscriptionPolicies.fromJson(reader);
+ } else if ("authorizationSource".equals(fieldName)) {
+ deserializedSubscriptionInner.authorizationSource = reader.getString();
+ } else if ("managedByTenants".equals(fieldName)) {
+ List managedByTenants
+ = reader.readArray(reader1 -> ManagedByTenant.fromJson(reader1));
+ deserializedSubscriptionInner.managedByTenants = managedByTenants;
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedSubscriptionInner.tags = tags;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSubscriptionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java
index 6ed92c3c65e23..0a5cefe67e9f6 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java
@@ -5,37 +5,38 @@
package com.azure.resourcemanager.resources.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.resources.models.TagCount;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Tag details.
*/
@Fluent
-public final class TagDetailsInner {
+public final class TagDetailsInner implements JsonSerializable {
/*
* The tag name ID.
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The tag name.
*/
- @JsonProperty(value = "tagName")
private String tagName;
/*
- * The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0.
+ * The total number of resources that use the resource tag. When a tag is initially created and has no associated
+ * resources, the value is 0.
*/
- @JsonProperty(value = "count")
private TagCount count;
/*
* The list of tag values.
*/
- @JsonProperty(value = "values")
private List values;
/**
@@ -128,4 +129,49 @@ public void validate() {
values().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("tagName", this.tagName);
+ jsonWriter.writeJsonField("count", this.count);
+ jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TagDetailsInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TagDetailsInner 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 TagDetailsInner.
+ */
+ public static TagDetailsInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TagDetailsInner deserializedTagDetailsInner = new TagDetailsInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedTagDetailsInner.id = reader.getString();
+ } else if ("tagName".equals(fieldName)) {
+ deserializedTagDetailsInner.tagName = reader.getString();
+ } else if ("count".equals(fieldName)) {
+ deserializedTagDetailsInner.count = TagCount.fromJson(reader);
+ } else if ("values".equals(fieldName)) {
+ List values = reader.readArray(reader1 -> TagValueInner.fromJson(reader1));
+ deserializedTagDetailsInner.values = values;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTagDetailsInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java
index 62b2ef0f03c6c..3353e8f3c20b9 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java
@@ -5,30 +5,31 @@
package com.azure.resourcemanager.resources.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.resources.models.TagCount;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Tag information.
*/
@Fluent
-public final class TagValueInner {
+public final class TagValueInner implements JsonSerializable {
/*
* The tag value ID.
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The tag value.
*/
- @JsonProperty(value = "tagValue")
private String tagValue;
/*
* The tag value count.
*/
- @JsonProperty(value = "count")
private TagCount count;
/**
@@ -96,4 +97,45 @@ public void validate() {
count().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("tagValue", this.tagValue);
+ jsonWriter.writeJsonField("count", this.count);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TagValueInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TagValueInner 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 TagValueInner.
+ */
+ public static TagValueInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TagValueInner deserializedTagValueInner = new TagValueInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedTagValueInner.id = reader.getString();
+ } else if ("tagValue".equals(fieldName)) {
+ deserializedTagValueInner.tagValue = reader.getString();
+ } else if ("count".equals(fieldName)) {
+ deserializedTagValueInner.count = TagCount.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTagValueInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java
index 69859c2556c1d..30ed6c0b0bcb3 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java
@@ -7,8 +7,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
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.resources.models.Tags;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
/**
* Wrapper resource for tags API requests and responses.
@@ -18,9 +21,23 @@ public final class TagsResourceInner extends ProxyResource {
/*
* The set of tags.
*/
- @JsonProperty(value = "properties", required = true)
private Tags properties;
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
/**
* Creates an instance of TagsResourceInner class.
*/
@@ -47,6 +64,36 @@ public TagsResourceInner withProperties(Tags properties) {
return this;
}
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
/**
* Validates the instance.
*
@@ -62,4 +109,47 @@ public void validate() {
}
private static final ClientLogger LOGGER = new ClientLogger(TagsResourceInner.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TagsResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TagsResourceInner 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 TagsResourceInner.
+ */
+ public static TagsResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TagsResourceInner deserializedTagsResourceInner = new TagsResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedTagsResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedTagsResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedTagsResourceInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedTagsResourceInner.properties = Tags.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTagsResourceInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java
index b1bf3a1e5b02e..c299bdd1d9721 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java
@@ -5,23 +5,25 @@
package com.azure.resourcemanager.resources.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;
/**
* Result of the request to calculate template hash. It contains a string of minified template and its hash.
*/
@Fluent
-public final class TemplateHashResultInner {
+public final class TemplateHashResultInner implements JsonSerializable {
/*
* The minified template string.
*/
- @JsonProperty(value = "minifiedTemplate")
private String minifiedTemplate;
/*
* The template hash.
*/
- @JsonProperty(value = "templateHash")
private String templateHash;
/**
@@ -77,4 +79,43 @@ public TemplateHashResultInner withTemplateHash(String templateHash) {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("minifiedTemplate", this.minifiedTemplate);
+ jsonWriter.writeStringField("templateHash", this.templateHash);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TemplateHashResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TemplateHashResultInner 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 TemplateHashResultInner.
+ */
+ public static TemplateHashResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TemplateHashResultInner deserializedTemplateHashResultInner = new TemplateHashResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("minifiedTemplate".equals(fieldName)) {
+ deserializedTemplateHashResultInner.minifiedTemplate = reader.getString();
+ } else if ("templateHash".equals(fieldName)) {
+ deserializedTemplateHashResultInner.templateHash = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTemplateHashResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java
index 7e5386f4a15a2..05e55c956f117 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java
@@ -5,73 +5,67 @@
package com.azure.resourcemanager.resources.fluent.models;
import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.TenantCategory;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Tenant Id information.
*/
@Immutable
-public final class TenantIdDescriptionInner {
+public final class TenantIdDescriptionInner implements JsonSerializable {
/*
* The fully qualified ID of the tenant. For example, /tenants/8d65815f-a5b6-402f-9298-045155da7d74
*/
- @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
private String id;
/*
* The tenant ID. For example, 8d65815f-a5b6-402f-9298-045155da7d74
*/
- @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
private String tenantId;
/*
* Category of the tenant.
*/
- @JsonProperty(value = "tenantCategory", access = JsonProperty.Access.WRITE_ONLY)
private TenantCategory tenantCategory;
/*
* Country/region name of the address for the tenant.
*/
- @JsonProperty(value = "country", access = JsonProperty.Access.WRITE_ONLY)
private String country;
/*
* Country/region abbreviation for the tenant.
*/
- @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY)
private String countryCode;
/*
* The display name of the tenant.
*/
- @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
private String displayName;
/*
* The list of domains for the tenant.
*/
- @JsonProperty(value = "domains", access = JsonProperty.Access.WRITE_ONLY)
private List domains;
/*
* The default domain for the tenant.
*/
- @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY)
private String defaultDomain;
/*
* The tenant type. Only available for 'Home' tenant category.
*/
- @JsonProperty(value = "tenantType", access = JsonProperty.Access.WRITE_ONLY)
private String tenantType;
/*
* The tenant's branding logo URL. Only available for 'Home' tenant category.
*/
- @JsonProperty(value = "tenantBrandingLogoUrl", access = JsonProperty.Access.WRITE_ONLY)
private String tenantBrandingLogoUrl;
/**
@@ -179,4 +173,58 @@ public String tenantBrandingLogoUrl() {
*/
public void validate() {
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TenantIdDescriptionInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TenantIdDescriptionInner 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 TenantIdDescriptionInner.
+ */
+ public static TenantIdDescriptionInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TenantIdDescriptionInner deserializedTenantIdDescriptionInner = new TenantIdDescriptionInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.id = reader.getString();
+ } else if ("tenantId".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.tenantId = reader.getString();
+ } else if ("tenantCategory".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.tenantCategory = TenantCategory.fromString(reader.getString());
+ } else if ("country".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.country = reader.getString();
+ } else if ("countryCode".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.countryCode = reader.getString();
+ } else if ("displayName".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.displayName = reader.getString();
+ } else if ("domains".equals(fieldName)) {
+ List domains = reader.readArray(reader1 -> reader1.getString());
+ deserializedTenantIdDescriptionInner.domains = domains;
+ } else if ("defaultDomain".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.defaultDomain = reader.getString();
+ } else if ("tenantType".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.tenantType = reader.getString();
+ } else if ("tenantBrandingLogoUrl".equals(fieldName)) {
+ deserializedTenantIdDescriptionInner.tenantBrandingLogoUrl = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTenantIdDescriptionInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java
index 171627c32d7dc..ac33341b5d4be 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java
@@ -5,19 +5,22 @@
package com.azure.resourcemanager.resources.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.resources.models.WhatIfChange;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
* Deployment operation properties.
*/
@Fluent
-public final class WhatIfOperationProperties {
+public final class WhatIfOperationProperties implements JsonSerializable {
/*
* List of resource changes predicted by What-If operation.
*/
- @JsonProperty(value = "changes")
private List changes;
/**
@@ -56,4 +59,41 @@ public void validate() {
changes().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("changes", this.changes, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of WhatIfOperationProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of WhatIfOperationProperties 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 WhatIfOperationProperties.
+ */
+ public static WhatIfOperationProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ WhatIfOperationProperties deserializedWhatIfOperationProperties = new WhatIfOperationProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("changes".equals(fieldName)) {
+ List changes = reader.readArray(reader1 -> WhatIfChange.fromJson(reader1));
+ deserializedWhatIfOperationProperties.changes = changes;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedWhatIfOperationProperties;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java
index f17b40a0a9835..31a900c9cc0de 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java
@@ -6,8 +6,12 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.resources.models.WhatIfChange;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
/**
@@ -15,25 +19,20 @@
* results.
*/
@Fluent
-public final class WhatIfOperationResultInner {
+public final class WhatIfOperationResultInner implements JsonSerializable {
/*
* Status of the What-If operation.
*/
- @JsonProperty(value = "status")
private String status;
/*
* What-If operation properties.
*/
- @JsonProperty(value = "properties")
private WhatIfOperationProperties innerProperties;
/*
- * Error Response
- *
* Error when What-If operation fails.
*/
- @JsonProperty(value = "error")
private ManagementError error;
/**
@@ -72,9 +71,7 @@ private WhatIfOperationProperties innerProperties() {
}
/**
- * Get the error property: Error Response
- *
- * Error when What-If operation fails.
+ * Get the error property: Error when What-If operation fails.
*
* @return the error value.
*/
@@ -83,9 +80,7 @@ public ManagementError error() {
}
/**
- * Set the error property: Error Response
- *
- * Error when What-If operation fails.
+ * Set the error property: Error when What-If operation fails.
*
* @param error the error value to set.
* @return the WhatIfOperationResultInner object itself.
@@ -128,4 +123,46 @@ public void validate() {
innerProperties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("status", this.status);
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ jsonWriter.writeJsonField("error", this.error);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of WhatIfOperationResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of WhatIfOperationResultInner 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 WhatIfOperationResultInner.
+ */
+ public static WhatIfOperationResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ WhatIfOperationResultInner deserializedWhatIfOperationResultInner = new WhatIfOperationResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("status".equals(fieldName)) {
+ deserializedWhatIfOperationResultInner.status = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedWhatIfOperationResultInner.innerProperties = WhatIfOperationProperties.fromJson(reader);
+ } else if ("error".equals(fieldName)) {
+ deserializedWhatIfOperationResultInner.error = ManagementError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedWhatIfOperationResultInner;
+ });
+ }
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/CheckNameAvailabilityReason.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/CheckNameAvailabilityReason.java
index 561da74cd3ae4..e9ff51b812b98 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/CheckNameAvailabilityReason.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/arm/models/CheckNameAvailabilityReason.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.resources.fluentcore.arm.models;
import com.azure.core.util.ExpandableStringEnum;
-import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;
@@ -23,7 +22,6 @@ public final class CheckNameAvailabilityReason extends ExpandableStringEnum voidResponse(PollResponse> pollRes
}
}
- private static class ResourceWithProvisioningState {
- @JsonProperty(value = "properties")
+ private static class ResourceWithProvisioningState implements JsonSerializable {
private Properties properties;
private String getProvisioningState() {
@@ -308,9 +310,58 @@ private String getProvisioningState() {
}
}
- private static class Properties {
- @JsonProperty(value = "provisioningState")
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ return jsonWriter
+ .writeStartObject()
+ .writeJsonField("properties", properties)
+ .writeEndObject();
+ }
+
+ public static ResourceWithProvisioningState fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceWithProvisioningState resourceWithProvisioningState = new ResourceWithProvisioningState();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("properties".equals(fieldName)) {
+ resourceWithProvisioningState.properties = reader.readObject(Properties::fromJson);
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return resourceWithProvisioningState;
+ });
+ }
+
+ private static class Properties implements JsonSerializable {
private String provisioningState;
+
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ return jsonWriter
+ .writeStartObject()
+ .writeStringField("provisioningState", provisioningState)
+ .writeEndObject();
+ }
+
+ public static Properties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ Properties result = new Properties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("provisioningState".equals(fieldName)) {
+ result.provisioningState = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return result;
+ });
+ }
}
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java
index 6d7c1ac7aa1b2..19c46830117bb 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.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> listNextSinglePageAsync(String nextL
/**
* 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/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java
index d04da0ce3767e..4d6ffb42e438c 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java
@@ -467,9 +467,7 @@ public ChangeResourceResultInner get(String resourceGroupName, String resourcePr
/**
* 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.
@@ -494,9 +492,7 @@ private Mono> listNextSinglePageAsync(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/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java
index ace3ddb0251e4..079af00565d79 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java
@@ -359,9 +359,7 @@ public PagedIterable list(String filter, Context contex
/**
* 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.
@@ -386,9 +384,7 @@ private Mono> listNextSinglePageAsync(Str
/**
* 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/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java
index 7b60685ba5f6e..30a92cb15a784 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentExportResultImpl.java
@@ -3,11 +3,14 @@
package com.azure.resourcemanager.resources.implementation;
-import com.azure.resourcemanager.resources.models.DeploymentExportResult;
-import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl;
+import com.azure.resourcemanager.resources.models.DeploymentExportResult;
+
+import java.io.IOException;
/**
* Implementation for {@link DeploymentExportResult}.
@@ -17,11 +20,11 @@ final class DeploymentExportResultImpl extends
implements
DeploymentExportResult {
- private ObjectMapper mapper;
+ private SerializerAdapter serializerAdapter;
DeploymentExportResultImpl(DeploymentExportResultInner innerModel) {
super(innerModel);
- mapper = new ObjectMapper();
+ serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
}
@Override
@@ -32,8 +35,8 @@ public Object template() {
@Override
public String templateAsJson() {
try {
- return mapper.writeValueAsString(template());
- } catch (JsonProcessingException e) {
+ return serializerAdapter.serialize(template(), SerializerEncoding.JSON);
+ } catch (IOException e) {
return null;
}
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java
index 2540ed7e5b172..34c2e3eb6a0e9 100644
--- a/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java
@@ -3,6 +3,7 @@
package com.azure.resourcemanager.resources.implementation;
+import com.azure.core.management.Region;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.Context;
@@ -10,10 +11,19 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.core.util.serializer.TypeReference;
+import com.azure.json.JsonProviders;
+import com.azure.json.JsonReader;
import com.azure.resourcemanager.resources.ResourceManager;
+import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner;
+import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
+import com.azure.resourcemanager.resources.fluent.models.ProviderInner;
+import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils;
import com.azure.resourcemanager.resources.fluentcore.model.Accepted;
+import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
import com.azure.resourcemanager.resources.fluentcore.model.Indexable;
import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl;
+import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl;
import com.azure.resourcemanager.resources.models.DebugSetting;
import com.azure.resourcemanager.resources.models.Dependency;
import com.azure.resourcemanager.resources.models.Deployment;
@@ -34,15 +44,6 @@
import com.azure.resourcemanager.resources.models.TemplateLink;
import com.azure.resourcemanager.resources.models.WhatIfOperationResult;
import com.azure.resourcemanager.resources.models.WhatIfResultFormat;
-import com.azure.core.management.Region;
-import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils;
-import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
-import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl;
-import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner;
-import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
-import com.azure.resourcemanager.resources.fluent.models.ProviderInner;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
import reactor.core.publisher.Mono;
import java.io.IOException;
@@ -66,7 +67,6 @@ public final class DeploymentImpl extends
private final ClientLogger logger = new ClientLogger(DeploymentImpl.class);
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private static final SerializerAdapter SERIALIZER_ADAPTER =
SerializerFactory.createDefaultManagementSerializerAdapter();
private static final TypeReference